mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Change return type
This commit is contained in:
parent
a31860dc5f
commit
346e95c33c
@ -19,5 +19,5 @@ import type {HomeServerApi} from "../net/HomeServerApi.js";
|
|||||||
|
|
||||||
export interface ILoginMethod {
|
export interface ILoginMethod {
|
||||||
homeserver: string;
|
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;
|
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();
|
return await hsApi.passwordLogin(this._username, this._password, deviceName, {log}).response();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ export class TokenLoginMethod implements ILoginMethod {
|
|||||||
this._loginToken = loginToken;
|
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();
|
return await hsApi.tokenLogin(this._loginToken, makeTxnId(), deviceName, {log}).response();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user