1
0
mirror of https://github.com/vector-im/hydrogen-web.git synced 2025-01-14 05:57:26 +01:00

Change return type

This commit is contained in:
RMidhunSuresh 2021-11-25 12:33:12 +05:30
parent a31860dc5f
commit 346e95c33c
3 changed files with 3 additions and 3 deletions

@ -19,5 +19,5 @@ import type {HomeServerApi} from "../net/HomeServerApi.js";
export interface ILoginMethod {
homeserver: string;
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]>;
login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>>;
}

@ -29,7 +29,7 @@ export class PasswordLoginMethod implements ILoginMethod {
this.homeserver = homeserver;
}
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]> {
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>> {
return await hsApi.passwordLogin(this._username, this._password, deviceName, {log}).response();
}
}

@ -28,7 +28,7 @@ export class TokenLoginMethod implements ILoginMethod {
this._loginToken = loginToken;
}
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Response["body"]> {
async login(hsApi: HomeServerApi, deviceName: string, log: ILogItem): Promise<Record<string, any>> {
return await hsApi.tokenLogin(this._loginToken, makeTxnId(), deviceName, {log}).response();
}
}