mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Pass log as argument
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
9651817c5b
commit
f3946fcdf3
@ -106,7 +106,7 @@ export class SessionContainer {
|
||||
const result = {};
|
||||
for (const flow of flows) {
|
||||
if (flow.type === "m.login.password") {
|
||||
result.password = (username, password) => new PasswordLoginMethod({homeServer, username, password, platform: this._platform});
|
||||
result.password = (username, password) => new PasswordLoginMethod({homeServer, username, password});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -15,13 +15,12 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
export class LoginMethod {
|
||||
constructor({homeServer, platform}) {
|
||||
constructor({homeServer}) {
|
||||
this.homeServer = homeServer;
|
||||
this._platform = platform;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
async login(hsApi, deviceName) {
|
||||
async login(hsApi, deviceName, log) {
|
||||
/*
|
||||
Regardless of the login method, SessionContainer.startWithLogin()
|
||||
can do SomeLoginMethod.login()
|
||||
|
@ -23,9 +23,7 @@ export class PasswordLoginMethod extends LoginMethod {
|
||||
this.password = options.password;
|
||||
}
|
||||
|
||||
async login(hsApi, deviceName) {
|
||||
return this._platform.logger.run("passwordLogin", async log =>
|
||||
await hsApi.passwordLogin(this.username, this.password, deviceName, {log}).response()
|
||||
);
|
||||
async login(hsApi, deviceName, log) {
|
||||
return await hsApi.passwordLogin(this.username, this.password, deviceName, {log}).response();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user