File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
libs/feature/two-factor/src/lib Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export class TwoFactorService {
3535 // Length of the generated tokens.
3636 digits : 6 ,
3737 // Interval of time for which a token is valid, in seconds.
38- ...( options . timeout ? { period : options . timeout / 1000 } : { } ) ,
38+ ...( options . timeout ? { period : Math . floor ( options . timeout / 1000 ) } : { } ) ,
3939 // Arbitrary key encoded in base32 or `OTPAuth.Secret` instance
4040 // (if omitted, a cryptographically secure random secret is generated).
4141 secret : OTPAuth . Secret . fromBase32 ( options . secret ) ,
@@ -218,7 +218,7 @@ export class TwoFactorService {
218218 const tokenIsValid =
219219 totp . validate ( {
220220 token : options . code ,
221- window : timeout / 1000 / 30 ,
221+ window : 1 ,
222222 } ) !== null ;
223223
224224 if ( ! tokenIsValid ) {
You can’t perform that action at this time.
0 commit comments