mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-09-08 10:23:57 +00:00
fix 2fa not working #833
This commit is contained in:
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…
Reference in New Issue
Block a user