Merge pull request #13650 from vector-im/t3chguy/sso_hash

Pass screenAfterLogin through SSO in the callback url
pull/13688/head
Michael Telatynski 2020-05-14 17:30:32 +01:00 committed by GitHub
commit 7246d9f2d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -448,15 +448,16 @@ export default class ElectronPlatform extends VectorBasePlatform {
}); });
} }
getSSOCallbackUrl(hsUrl: string, isUrl: string): URL { getSSOCallbackUrl(hsUrl: string, isUrl: string, fragmentAfterLogin: string): URL {
const url = super.getSSOCallbackUrl(hsUrl, isUrl); const url = super.getSSOCallbackUrl(hsUrl, isUrl, fragmentAfterLogin);
url.protocol = "riot"; url.protocol = "riot";
url.searchParams.set("riot-desktop-ssoid", this.ssoID); url.searchParams.set("riot-desktop-ssoid", this.ssoID);
return url; return url;
} }
startSingleSignOn(mxClient: MatrixClient, loginType: "sso" | "cas") { startSingleSignOn(mxClient: MatrixClient, loginType: "sso" | "cas", fragmentAfterLogin: string) {
super.startSingleSignOn(mxClient, loginType); // this will get intercepted by electron-main will-navigate // this will get intercepted by electron-main will-navigate
super.startSingleSignOn(mxClient, loginType, fragmentAfterLogin);
Modal.createTrackedDialog('Electron', 'SSO', InfoDialog, { Modal.createTrackedDialog('Electron', 'SSO', InfoDialog, {
title: _t("Go to your browser to complete Sign In"), title: _t("Go to your browser to complete Sign In"),
description: <Spinner />, description: <Spinner />,