Merge pull request #27017 from element-hq/t3chguy/oidc-desktop

Fix Native OIDC for Element Desktop
pull/27039/head
Michael Telatynski 2024-02-19 15:30:19 +00:00 committed by GitHub
commit 35fe447aae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -57,6 +57,8 @@ interface SquirrelUpdate {
updateURL: string;
}
const SSO_ID_KEY = "element-desktop-ssoid";
const isMac = navigator.platform.toUpperCase().includes("MAC");
function platformFriendlyName(): string {
@ -378,7 +380,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
public getSSOCallbackUrl(fragmentAfterLogin: string): URL {
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
url.protocol = "element";
url.searchParams.set("element-desktop-ssoid", this.ssoID);
url.searchParams.set(SSO_ID_KEY, this.ssoID);
return url;
}
@ -451,4 +453,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
clientUri: "https://element.io",
};
}
public getOidcClientState(): string {
return `:${SSO_ID_KEY}:${this.ssoID}`;
}
}