Change return type
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue