avoid default values for token verification

override default values: window=1, window size=30 (see https://github.com/louislam/uptime-kuma/issues/640)
This commit is contained in:
Andreas Brett 2021-10-10 22:13:18 +02:00 committed by GitHub
parent ad0cde6554
commit b5b391c73b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,7 +265,7 @@ exports.entryPage = "dashboard";
}
if (data.token) {
let verify = notp.totp.verify(data.token, user.twofa_secret);
let verify = notp.totp.verify(data.token, user.twofa_secret, {"window": 1, "time": 30});
if (verify && verify.delta == 0) {
callback({
@ -383,7 +383,7 @@ exports.entryPage = "dashboard";
socket.userID,
]);
let verify = notp.totp.verify(token, user.twofa_secret);
let verify = notp.totp.verify(token, user.twofa_secret, {"window": 1, "time": 30});
if (verify && verify.delta == 0) {
callback({