Merge pull request #1 from loopingz/master

Allow to specify time in verify
This commit is contained in:
Gin 2018-03-05 14:06:59 +08:00 committed by GitHub
commit 84ead06780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,8 +72,8 @@ export class TOTP extends OTP {
if (time == null) { if (time == null) {
time = new Date(); time = new Date();
otp_time = this.now();
} }
otp_time = super.generate_otp(Util.timecode(time, this.interval));
if (otp === otp_time) { if (otp === otp_time) {
return true; return true;