Merge pull request #1503 from Kisakay/main
Fix TOTP Generation and Request Handler Access Path
This commit is contained in:
@@ -396,7 +396,7 @@ class RequestHandler {
|
|||||||
request.retries < 1
|
request.retries < 1
|
||||||
) {
|
) {
|
||||||
// Get mfa code
|
// Get mfa code
|
||||||
const { otp } = await TOTP.generate(this.options.TOTPKey);
|
const { otp } = await TOTP.generate(this.manager.client.options.TOTPKey);
|
||||||
this.manager.client.emit(
|
this.manager.client.emit(
|
||||||
DEBUG,
|
DEBUG,
|
||||||
`${data.message}
|
`${data.message}
|
||||||
|
|||||||
@@ -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