From ddf3d92d434ccec77f882b070e6bc1545ad29f86 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 2 Jun 2020 16:26:08 +0100 Subject: [PATCH 1/2] Fix login loop where the sso flow returns to `#/login` due to fragmentAfterLogin going back to `#/login` and https://github.com/vector-im/riot-web/issues/11643 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.tsx | 4 ++-- src/vector/platform/VectorBasePlatform.ts | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 62137063..f68614d4 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -457,8 +457,8 @@ export default class ElectronPlatform extends VectorBasePlatform { }); } - getSSOCallbackUrl(hsUrl: string, isUrl: string, fragmentAfterLogin: string): URL { - const url = super.getSSOCallbackUrl(hsUrl, isUrl, fragmentAfterLogin); + getSSOCallbackUrl(fragmentAfterLogin: string): URL { + const url = super.getSSOCallbackUrl(fragmentAfterLogin); url.protocol = "riot"; url.searchParams.set("riot-desktop-ssoid", this.ssoID); return url; diff --git a/src/vector/platform/VectorBasePlatform.ts b/src/vector/platform/VectorBasePlatform.ts index 0c3997e7..e9febd90 100644 --- a/src/vector/platform/VectorBasePlatform.ts +++ b/src/vector/platform/VectorBasePlatform.ts @@ -37,12 +37,6 @@ export const updateCheckStatusEnum = { export default abstract class VectorBasePlatform extends BasePlatform { protected _favicon: Favicon; - constructor() { - super(); - - this.startUpdateCheck = this.startUpdateCheck.bind(this); - } - async getConfig(): Promise<{}> { return getVectorConfig(); } From 1b7accddfd4d075ed2f9971b8a0821aa54a426f6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 3 Jun 2020 20:34:20 +0100 Subject: [PATCH 2/2] fix loading test for new sso pattern Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/app-tests/loading-test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/app-tests/loading-test.js b/test/app-tests/loading-test.js index 64872aaa..363be819 100644 --- a/test/app-tests/loading-test.js +++ b/test/app-tests/loading-test.js @@ -589,8 +589,10 @@ describe('loading:', function() { describe('Token login:', function() { it('logs in successfully', function() { + localStorage.setItem("mx_hs_url", "https://homeserver"); + localStorage.setItem("mx_is_url", "https://idserver"); loadApp({ - queryString: "?loginToken=secretToken&homeserver=https%3A%2F%2Fhomeserver&identityServer=https%3A%2F%2Fidserver", + queryString: "?loginToken=secretToken", }); return sleep(1).then(() => {