mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
notp verification defaults
This commit is contained in:
parent
e223e826a3
commit
2538bd04ce
1 changed files with 8 additions and 4 deletions
|
@ -68,6 +68,12 @@ const port = parseInt(process.env.PORT || args.port || 3001);
|
||||||
const sslKey = process.env.SSL_KEY || args["ssl-key"] || undefined;
|
const sslKey = process.env.SSL_KEY || args["ssl-key"] || undefined;
|
||||||
const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined;
|
const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined;
|
||||||
|
|
||||||
|
// 2FA / notp verification defaults
|
||||||
|
const twofa_verification_opts = {
|
||||||
|
"window": 1,
|
||||||
|
"time": 30
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run unit test after the server is ready
|
* Run unit test after the server is ready
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
@ -265,8 +271,7 @@ exports.entryPage = "dashboard";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.token) {
|
if (data.token) {
|
||||||
let verify = notp.totp.verify(data.token, user.twofa_secret, { "window": 1,
|
let verify = notp.totp.verify(data.token, user.twofa_secret, twofa_verification_opts);
|
||||||
"time": 30 });
|
|
||||||
|
|
||||||
if (verify && verify.delta == 0) {
|
if (verify && verify.delta == 0) {
|
||||||
callback({
|
callback({
|
||||||
|
@ -384,8 +389,7 @@ exports.entryPage = "dashboard";
|
||||||
socket.userID,
|
socket.userID,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let verify = notp.totp.verify(token, user.twofa_secret, { "window": 1,
|
let verify = notp.totp.verify(token, user.twofa_secret, twofa_verification_opts);
|
||||||
"time": 30 });
|
|
||||||
|
|
||||||
if (verify && verify.delta == 0) {
|
if (verify && verify.delta == 0) {
|
||||||
callback({
|
callback({
|
||||||
|
|
Loading…
Reference in a new issue