forked from mystiq/hydrogen-web
Fix password login
This commit is contained in:
parent
64037cb32a
commit
a1367f8e72
2 changed files with 8 additions and 8 deletions
|
@ -26,7 +26,7 @@ import {MediaRepository} from "./net/MediaRepository.js";
|
||||||
import {RequestScheduler} from "./net/RequestScheduler.js";
|
import {RequestScheduler} from "./net/RequestScheduler.js";
|
||||||
import {Sync, SyncStatus} from "./Sync.js";
|
import {Sync, SyncStatus} from "./Sync.js";
|
||||||
import {Session} from "./Session.js";
|
import {Session} from "./Session.js";
|
||||||
import {PasswordLoginMethod} from "./login/PasswordLoginMethod.js";
|
import {PasswordLoginMethod} from "./login/PasswordLoginMethod";
|
||||||
import {TokenLoginMethod} from "./login/TokenLoginMethod";
|
import {TokenLoginMethod} from "./login/TokenLoginMethod";
|
||||||
import {SSOLoginHelper} from "./login/SSOLoginHelper.js";
|
import {SSOLoginHelper} from "./login/SSOLoginHelper.js";
|
||||||
import {getDehydratedDevice} from "./e2ee/Dehydration.js";
|
import {getDehydratedDevice} from "./e2ee/Dehydration.js";
|
||||||
|
|
|
@ -19,17 +19,17 @@ import {ILoginMethod} from "./LoginMethod";
|
||||||
import {HomeServerApi} from "../net/HomeServerApi.js";
|
import {HomeServerApi} from "../net/HomeServerApi.js";
|
||||||
|
|
||||||
export class PasswordLoginMethod implements ILoginMethod {
|
export class PasswordLoginMethod implements ILoginMethod {
|
||||||
public username: string;
|
private readonly _username: string;
|
||||||
public password: string;
|
private readonly _password: string;
|
||||||
public homeserver: string;
|
public readonly homeserver: string;
|
||||||
|
|
||||||
constructor({username, password, homeserver}: {username: string, password: string, homeserver: string}) {
|
constructor({username, password, homeserver}: {username: string, password: string, homeserver: string}) {
|
||||||
this.username = username;
|
this._username = username;
|
||||||
this.password = password;
|
this._password = password;
|
||||||
this.homeserver = homeserver;
|
this.homeserver = homeserver;
|
||||||
}
|
}
|
||||||
|
|
||||||
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem) {
|
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]> {
|
||||||
return await hsApi.passwordLogin(this.username, this.password, deviceName, {log}).response();
|
return await hsApi.passwordLogin(this._username, this._password, deviceName, {log}).response();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue