forked from mystiq/hydrogen-web
Remove homeserver prop
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
dadeb7f3e5
commit
2468bc3e9f
3 changed files with 5 additions and 7 deletions
|
@ -100,9 +100,7 @@ export class LoginViewModel extends ViewModel {
|
|||
|
||||
_showSSOLogin() {
|
||||
this._startSSOLoginViewModel = this.track(
|
||||
new StartSSOLoginViewModel(
|
||||
this.childOptions({ loginOptions: this._loginOptions, homeserver: this._homeserver })
|
||||
)
|
||||
new StartSSOLoginViewModel(this.childOptions({loginOptions: this._loginOptions}))
|
||||
);
|
||||
this.emitChange("startSSOLoginViewModel");
|
||||
}
|
||||
|
|
|
@ -19,13 +19,11 @@ import {ViewModel} from "../ViewModel.js";
|
|||
export class StartSSOLoginViewModel extends ViewModel{
|
||||
constructor(options) {
|
||||
super(options);
|
||||
const {loginOptions, homeserver} = options;
|
||||
this._sso = loginOptions.sso;
|
||||
this._homeserver = homeserver;
|
||||
this._sso = options.loginOptions.sso;
|
||||
}
|
||||
|
||||
async startSSOLogin() {
|
||||
await this.platform.settingsStorage.setString("sso_ongoing_login_homeserver", this._homeserver);
|
||||
await this.platform.settingsStorage.setString("sso_ongoing_login_homeserver", this._sso.homeserver);
|
||||
const link = this._sso.createSSORedirectURL(this.urlCreator.createSSOCallbackURL());
|
||||
this.platform.openUrl(link);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ export class SSOLoginHelper{
|
|||
this._homeserver = homeserver;
|
||||
}
|
||||
|
||||
get homeserver() { return this._homeserver; }
|
||||
|
||||
createSSORedirectURL(returnURL) {
|
||||
return `${this._homeserver}/_matrix/client/r0/login/sso/redirect?redirectUrl=${returnURL}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue