Merge pull request #1503 from Kisakay/main

Fix TOTP Generation and Request Handler Access Path
This commit is contained in:
Elysia
2025-02-23 00:41:44 +07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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}

View File

@@ -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);