This commit is contained in:
H. Shay 2024-09-30 13:14:50 -07:00
parent 8e0f8400bc
commit c269984bb7
2 changed files with 2 additions and 3 deletions

View File

@ -73,8 +73,7 @@ import { initializeSentry, initializeGlobalPerformanceMetrics, patchMatrixClient
const accessToken = await Promise.resolve(storage.readValue("access_token"));
if (accessToken) {
client = new MatrixClient(config.homeserverUrl, accessToken, storage, cryptoStorage);
}
else {
} else {
const auth = new MatrixAuth(config.homeserverUrl)
const tempClient = await auth.passwordLogin(config.encryption.username, config.encryption.password)
client = new MatrixClient(config.homeserverUrl, tempClient.accessToken, storage, cryptoStorage);

View File

@ -130,7 +130,7 @@ async function registerNewTestUser(homeserver: string, options: RegistrationOpti
*
* @returns A new `MatrixClient` session for a unique test user.
*/
export async function newTestUser(homeserver: string, options: RegistrationOptions, encrypted: boolean = false): Promise<MatrixClient> {
export async function newTestUser(homeserver: string, options: RegistrationOptions, encrypted = false): Promise<MatrixClient> {
const accessToken = await registerNewTestUser(homeserver, options);
let client;
if (encrypted) {