fix 2fa not working #833

pull/842/head
Louis 3 years ago
parent c6fc385289
commit caa2a34177

@ -263,9 +263,8 @@ exports.entryPage = "dashboard";
let user = await login(data.username, data.password); let user = await login(data.username, data.password);
if (user) { if (user) {
afterLogin(socket, user);
if (user.twofaStatus == 0) { if (user.twofaStatus == 0) {
afterLogin(socket, user);
callback({ callback({
ok: true, ok: true,
token: jwt.sign({ token: jwt.sign({
@ -284,6 +283,7 @@ exports.entryPage = "dashboard";
let verify = notp.totp.verify(data.token, user.twofa_secret, twofa_verification_opts); let verify = notp.totp.verify(data.token, user.twofa_secret, twofa_verification_opts);
if (verify && verify.delta == 0) { if (verify && verify.delta == 0) {
afterLogin(socket, user);
callback({ callback({
ok: true, ok: true,
token: jwt.sign({ token: jwt.sign({

Loading…
Cancel
Save