mirror of https://gitgud.io/fatchan/jschan.git
indiachan-spamvector
parent
e5d0f9871f
commit
d9288a137a
4 changed files with 20 additions and 30 deletions
@ -0,0 +1,14 @@ |
|||||||
|
const OTPAuth = require('otpauth'); |
||||||
|
|
||||||
|
module.exports = (totpSecret, userInput) => { |
||||||
|
const totp = new OTPAuth.TOTP({ |
||||||
|
secret: totpSecret, |
||||||
|
algorithm: 'SHA256', |
||||||
|
}); |
||||||
|
const delta = totp.validate({ |
||||||
|
token: userInput, |
||||||
|
algorithm: 'SHA256', |
||||||
|
window: 1, |
||||||
|
}); |
||||||
|
return { totp, delta }; |
||||||
|
}; |
Loading…
Reference in new issue