fix: remove mfaCode from passLogin and make sure that code passes tests

This commit is contained in:
TheDevYellowy
2025-01-20 03:53:44 -06:00
parent 5fbca25c45
commit aaf5df1de3
2 changed files with 4 additions and 4 deletions

View File

@@ -16,10 +16,10 @@ class TOTP {
// eslint-disable-next-line valid-jsdoc // eslint-disable-next-line valid-jsdoc
/** /**
* Generates a Time-based One-Time Password (TOTP) * Generates a Time-based One-Time Password (TOTP)
* @async * @public
* @param {string} key - The secret key for TOTP * @param {string} key - The secret key for TOTP
* @param {generateOptions} options - Optional parameters for TOTP * @param {generateOptions} options - Optional parameters for TOTP
* @returns {Promise<{ otp: string; expires: number }>} * @returns {Promise<{ otp: string, expires: number }>}
*/ */
static async generate(key, options = {}) { static async generate(key, options = {}) {
const _options = { const _options = {

4
typings/index.d.ts vendored
View File

@@ -782,7 +782,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
public sleep(timeout: number): Promise<void>; public sleep(timeout: number): Promise<void>;
public login(token?: string): Promise<string>; public login(token?: string): Promise<string>;
/** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */ /** @deprecated This method will not be updated until I find the most convenient way to implement MFA. */
public passLogin(email: string, password: string, mfaCode?: string | number): Promise<string | null>; public passLogin(email: string, password: string): Promise<string | null>;
public QRLogin(): Promise<void>; public QRLogin(): Promise<void>;
public logout(): Promise<void>; public logout(): Promise<void>;
public isReady(): this is Client<true>; public isReady(): this is Client<true>;
@@ -3437,7 +3437,7 @@ export class TOTP {
private static buf2hex(buf: ArrayBuffer): string; private static buf2hex(buf: ArrayBuffer): string;
private static readonly base32: { [key: number]: number }; private static readonly base32: { [key: number]: number };
private static readonly crypto: SubtleCrypto; private static readonly crypto: SubtleCrypto;
static generate(key: string, options?: generateOptions): Promise<{ otp: string; expires: number}>; public static generate(key: string, options?: generateOptions): Promise<{ otp: string; expires: number}>;
} }
export type TOTPAlgorithm = "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512"; export type TOTPAlgorithm = "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512";