diff --git a/src/matrix/SessionContainer.js b/src/matrix/SessionContainer.js index 01ea85ff..2e64a2f6 100644 --- a/src/matrix/SessionContainer.js +++ b/src/matrix/SessionContainer.js @@ -26,7 +26,7 @@ import {MediaRepository} from "./net/MediaRepository.js"; import {RequestScheduler} from "./net/RequestScheduler.js"; import {Sync, SyncStatus} from "./Sync.js"; import {Session} from "./Session.js"; -import {PasswordLoginMethod} from "./login/PasswordLoginMethod.js"; +import {PasswordLoginMethod} from "./login/PasswordLoginMethod"; import {TokenLoginMethod} from "./login/TokenLoginMethod"; import {SSOLoginHelper} from "./login/SSOLoginHelper.js"; import {getDehydratedDevice} from "./e2ee/Dehydration.js"; diff --git a/src/matrix/login/PasswordLoginMethod.ts b/src/matrix/login/PasswordLoginMethod.ts index d9edd3e7..46fdd211 100644 --- a/src/matrix/login/PasswordLoginMethod.ts +++ b/src/matrix/login/PasswordLoginMethod.ts @@ -19,17 +19,17 @@ import {ILoginMethod} from "./LoginMethod"; import {HomeServerApi} from "../net/HomeServerApi.js"; export class PasswordLoginMethod implements ILoginMethod { - public username: string; - public password: string; - public homeserver: string; + private readonly _username: string; + private readonly _password: string; + public readonly homeserver: string; constructor({username, password, homeserver}: {username: string, password: string, homeserver: string}) { - this.username = username; - this.password = password; + this._username = username; + this._password = password; this.homeserver = homeserver; } - async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem) { - return await hsApi.passwordLogin(this.username, this.password, deviceName, {log}).response(); + async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise { + return await hsApi.passwordLogin(this._username, this._password, deviceName, {log}).response(); } }