hotFix(sendTwoFactor): fix code digits
This commit is contained in:
parent
2429d213da
commit
8580fa0849
|
@ -67,7 +67,9 @@ module.exports = Self => {
|
|||
if (vnUser.twoFactor === 'email') {
|
||||
const $ = Self.app.models;
|
||||
|
||||
const code = String(Math.floor(Math.random() * 999999));
|
||||
const min = 100000;
|
||||
const max = 999999;
|
||||
const code = String(Math.floor(Math.random() * (max - min + 1)) + min);
|
||||
const maxTTL = ((60 * 1000) * 5); // 5 min
|
||||
await $.AuthCode.upsertWithWhere({userFk: vnUser.id}, {
|
||||
userFk: vnUser.id,
|
||||
|
|
Loading…
Reference in New Issue