fix 2fa not working #833

This commit is contained in:
Louis 2021-10-30 02:35:05 +08:00
parent c6fc385289
commit caa2a34177
1 changed files with 2 additions and 2 deletions

View File

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