mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-03 06:01:45 +00:00
feat(desktop): use healthchat:// deep-link scheme instead of element://
Switch the friendly deep-link / legacy SSO callback scheme from element:// to healthchat:// and stop registering element:// entirely. The reverse-DNS OIDC primary scheme (ch.healthchat.desktop://) is unchanged. Also rebrand the round-tripped SSO id param element-desktop-ssoid -> healthchat-desktop-ssoid on both the desktop and web sides.
This commit is contained in:
@@ -456,7 +456,7 @@ export default abstract class BasePlatform {
|
||||
|
||||
/**
|
||||
* Suffix to append to the `state` parameter of OIDC /auth calls. Will be round-tripped to the callback URI.
|
||||
* Currently only required for ElectronPlatform for passing element-desktop-ssoid.
|
||||
* Currently only required for ElectronPlatform for passing healthchat-desktop-ssoid.
|
||||
*/
|
||||
public getOidcClientState(): string {
|
||||
return "";
|
||||
|
||||
@@ -53,7 +53,7 @@ interface SquirrelUpdate {
|
||||
updateURL: string;
|
||||
}
|
||||
|
||||
const SSO_ID_KEY = "element-desktop-ssoid";
|
||||
const SSO_ID_KEY = "healthchat-desktop-ssoid";
|
||||
|
||||
function platformFriendlyName(): string {
|
||||
// used to use window.process but the same info is available here
|
||||
@@ -466,7 +466,7 @@ export default class ElectronPlatform extends BasePlatform {
|
||||
|
||||
public getSSOCallbackUrl(fragmentAfterLogin?: string): URL {
|
||||
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
|
||||
url.protocol = "element";
|
||||
url.protocol = "healthchat";
|
||||
url.searchParams.set(SSO_ID_KEY, this.sessionId);
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ describe("ElectronPlatform", () => {
|
||||
it("should return oidc client state as expected", async () => {
|
||||
const platform = new ElectronPlatform();
|
||||
await platform.getConfig();
|
||||
expect(platform.getOidcClientState()).toMatchInlineSnapshot(`":element-desktop-ssoid:session-id"`);
|
||||
expect(platform.getOidcClientState()).toMatchInlineSnapshot(`":healthchat-desktop-ssoid:session-id"`);
|
||||
});
|
||||
|
||||
it("dispatches view settings action on preferences event", () => {
|
||||
|
||||
Reference in New Issue
Block a user