mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Remove homeserver prop
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
dadeb7f3e5
commit
2468bc3e9f
@ -100,9 +100,7 @@ export class LoginViewModel extends ViewModel {
|
|||||||
|
|
||||||
_showSSOLogin() {
|
_showSSOLogin() {
|
||||||
this._startSSOLoginViewModel = this.track(
|
this._startSSOLoginViewModel = this.track(
|
||||||
new StartSSOLoginViewModel(
|
new StartSSOLoginViewModel(this.childOptions({loginOptions: this._loginOptions}))
|
||||||
this.childOptions({ loginOptions: this._loginOptions, homeserver: this._homeserver })
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
this.emitChange("startSSOLoginViewModel");
|
this.emitChange("startSSOLoginViewModel");
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,11 @@ import {ViewModel} from "../ViewModel.js";
|
|||||||
export class StartSSOLoginViewModel extends ViewModel{
|
export class StartSSOLoginViewModel extends ViewModel{
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
const {loginOptions, homeserver} = options;
|
this._sso = options.loginOptions.sso;
|
||||||
this._sso = loginOptions.sso;
|
|
||||||
this._homeserver = homeserver;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async startSSOLogin() {
|
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());
|
const link = this._sso.createSSORedirectURL(this.urlCreator.createSSOCallbackURL());
|
||||||
this.platform.openUrl(link);
|
this.platform.openUrl(link);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ export class SSOLoginHelper{
|
|||||||
this._homeserver = homeserver;
|
this._homeserver = homeserver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get homeserver() { return this._homeserver; }
|
||||||
|
|
||||||
createSSORedirectURL(returnURL) {
|
createSSORedirectURL(returnURL) {
|
||||||
return `${this._homeserver}/_matrix/client/r0/login/sso/redirect?redirectUrl=${returnURL}`;
|
return `${this._homeserver}/_matrix/client/r0/login/sso/redirect?redirectUrl=${returnURL}`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user