feat: switch user

This commit is contained in:
Yellowy
2023-01-18 00:00:13 -07:00
parent 597eb2979c
commit c429e3313a
2 changed files with 22 additions and 2 deletions

View File

@@ -418,6 +418,19 @@ class Client extends BaseClient {
}
}
/**
* Switch the user
* @param {string | switchUserOptions} options Either the token or an object with the username, password, and mfaCode
*/
async switchUser(options) {
await this.logout();
if (typeof options == 'string') {
await this.login(options);
} else {
await this.normalLogin(options.username, options.password, options.mfaCode);
}
}
/**
* Sign in with the QR code on your phone.
* @param {boolean} debug Debug mode