Fixing TOTP issue with the timestamp
This commit is contained in:
@@ -30,7 +30,7 @@ class TOTP {
|
|||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
...options,
|
...options,
|
||||||
};
|
};
|
||||||
const epochSeconds = Math.floor(_options.timestam / 1000);
|
const epochSeconds = Math.floor(_options.timestamp / 1000);
|
||||||
const timeHex = this.dec2hex(Math.floor(epochSeconds / _options.period)).padStart(16, '0');
|
const timeHex = this.dec2hex(Math.floor(epochSeconds / _options.period)).padStart(16, '0');
|
||||||
|
|
||||||
const keyBuffer = _options.encoding === 'hex' ? this.base32ToBuffer(key) : this.asciiToBuffer(key);
|
const keyBuffer = _options.encoding === 'hex' ? this.base32ToBuffer(key) : this.asciiToBuffer(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user