Sync DNS2 production changes - removed obsolete test suite and refactored structure
This commit is contained in:
@@ -10,8 +10,8 @@ module.exports = function(ctx) {
|
||||
config: {
|
||||
enabled: ctx.totpConfig.enabled,
|
||||
sessionDuration: ctx.totpConfig.sessionDuration,
|
||||
isSetUp: ctx.totpConfig.isSetUp,
|
||||
},
|
||||
isSetUp: ctx.totpConfig.isSetUp
|
||||
}
|
||||
});
|
||||
}, 'totp-config-get'));
|
||||
|
||||
@@ -35,7 +35,7 @@ module.exports = function(ctx) {
|
||||
const otpauth = authenticator.keyuri('user', 'DashCaddy', secret);
|
||||
const qrDataUrl = await QRCode.toDataURL(otpauth, {
|
||||
width: 256, margin: 2,
|
||||
color: { dark: '#ffffff', light: '#00000000' },
|
||||
color: { dark: '#ffffff', light: '#00000000' }
|
||||
});
|
||||
|
||||
res.json({ success: true, qrCode: qrDataUrl, manualKey: secret, issuer: 'DashCaddy', imported: !!req.body?.secret });
|
||||
@@ -166,7 +166,7 @@ module.exports = function(ctx) {
|
||||
|
||||
if (sessionDuration && !ctx.session.durations.hasOwnProperty(sessionDuration)) {
|
||||
return ctx.errorResponse(res, 400, 'Invalid session duration', {
|
||||
validOptions: Object.keys(ctx.session.durations),
|
||||
validOptions: Object.keys(ctx.session.durations)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ module.exports = function(ctx) {
|
||||
await ctx.saveTotpConfig();
|
||||
res.json({
|
||||
success: true,
|
||||
config: { enabled: ctx.totpConfig.enabled, sessionDuration: ctx.totpConfig.sessionDuration, isSetUp: ctx.totpConfig.isSetUp },
|
||||
config: { enabled: ctx.totpConfig.enabled, sessionDuration: ctx.totpConfig.sessionDuration, isSetUp: ctx.totpConfig.isSetUp }
|
||||
});
|
||||
}, 'totp-config'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user