Skip to content

Commit f43bb0a

Browse files
authored
Merge pull request #27431 from element-hq/t3chguy/fix-oidc-native-electron
Fix `element-desktop-ssoid being` included in OIDC Authorization call
2 parents e651330 + 64f0bb5 commit f43bb0a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/vector/platform/ElectronPlatform.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,9 @@ export default class ElectronPlatform extends VectorBasePlatform {
446446

447447
public async getOidcClientMetadata(): Promise<OidcRegistrationClientMetadata> {
448448
const baseMetadata = await super.getOidcClientMetadata();
449-
const redirectUri = this.getSSOCallbackUrl();
450-
redirectUri.searchParams.delete(SSO_ID_KEY); // it will be shuttled via the state param instead
451449
return {
452450
...baseMetadata,
453451
applicationType: "native",
454-
redirectUris: [redirectUri.href],
455452
// XXX: This should be overridable in config
456453
clientUri: "https://element.io",
457454
};
@@ -460,4 +457,13 @@ export default class ElectronPlatform extends VectorBasePlatform {
460457
public getOidcClientState(): string {
461458
return `:${SSO_ID_KEY}:${this.ssoID}`;
462459
}
460+
461+
/**
462+
* The URL to return to after a successful OIDC authentication
463+
*/
464+
public getOidcCallbackUrl(): URL {
465+
const url = super.getOidcCallbackUrl();
466+
url.protocol = "io.element.desktop";
467+
return url;
468+
}
463469
}

0 commit comments

Comments
 (0)