Good progress on 2FA/OTP config: Most of email register lifecycle complete

This commit is contained in:
Bryan Ashby 2019-06-13 19:47:04 -06:00
parent 3efea3de9a
commit 94747cfe7e
No known key found for this signature in database
GPG key ID: B49EB437951D2542
4 changed files with 107 additions and 60 deletions

View file

@ -370,6 +370,7 @@ function twoFactorAuthOTP(user) {
const {
OTPTypes,
prepareOTP,
createBackupCodes,
} = require('../../core/user_2fa_otp.js');
let otpType = argv._[argv._.length - 1];
@ -414,7 +415,7 @@ function twoFactorAuthOTP(user) {
qrType : argv['qr-type'] || 'ascii',
};
prepareOTP(otpType, otpOpts, (err, otpInfo) => {
return callback(err, Object.assign(otpInfo, { otpType }));
return callback(err, Object.assign(otpInfo, { otpType, backupCodes : createBackupCodes() }));
});
},
function storeOrDisplayQR(otpInfo, callback) {