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:
2026-06-23 15:09:30 +02:00
parent 05705a8983
commit eee3275f0c
5 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ describe("ProtocolHandler", () => {
expect(
handler.getProfileFromDeeplink([
"Element.app",
`element://vector/webapp/?element-desktop-ssoid=${TEST_SESSION_ID}`,
`healthchat://vector/webapp/?healthchat-desktop-ssoid=${TEST_SESSION_ID}`,
]),
).toBe(USER_DATA_DIR);
});
@@ -56,7 +56,7 @@ describe("ProtocolHandler", () => {
expect(
handler.getProfileFromDeeplink([
"Element.app",
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true&code=DEADBEEF&state=foobar:element-desktop-ssoid:${TEST_SESSION_ID}`,
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true&code=DEADBEEF&state=foobar:healthchat-desktop-ssoid:${TEST_SESSION_ID}`,
]),
).toBe(USER_DATA_DIR);
});
@@ -65,7 +65,7 @@ describe("ProtocolHandler", () => {
expect(
handler.getProfileFromDeeplink([
"Element.app",
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true#code=DEADBEEF&state=foobar:element-desktop-ssoid:${TEST_SESSION_ID}`,
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true#code=DEADBEEF&state=foobar:healthchat-desktop-ssoid:${TEST_SESSION_ID}`,
]),
).toBe(USER_DATA_DIR);
});
@@ -74,7 +74,7 @@ describe("ProtocolHandler", () => {
expect(
handler.getProfileFromDeeplink([
"Element.app",
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true#code=DEADBEEF:element-desktop-ssoid:${TEST_SESSION_ID}`,
`${TEST_PROTOCOL}:/vector/webapp/?no_universal_links=true#code=DEADBEEF:healthchat-desktop-ssoid:${TEST_SESSION_ID}`,
]),
).toBeUndefined();
});
+4 -4
View File
@@ -12,8 +12,8 @@ import path from "node:path";
import fs from "node:fs";
import { randomUUID } from "node:crypto";
const LEGACY_PROTOCOL = "element";
const SEARCH_PARAM = "element-desktop-ssoid";
const LEGACY_PROTOCOL = "healthchat";
const SEARCH_PARAM = "healthchat-desktop-ssoid";
const STORE_FILE_NAME = "sso-sessions.json";
// we getPath userData before electron-main changes it, so this is the default value
@@ -130,8 +130,8 @@ export default class ProtocolHandler {
const store = this.readStore();
let sessionId = parsedUrl.searchParams.get(SEARCH_PARAM);
if (!sessionId) {
// In OIDC, we must shuttle the value in the `state` param rather than `element-desktop-ssoid`
// We encode it as a suffix like `:element-desktop-ssoid:XXYYZZ`.
// In OIDC, we must shuttle the value in the `state` param rather than `healthchat-desktop-ssoid`
// We encode it as a suffix like `:healthchat-desktop-ssoid:XXYYZZ`.
// The OIDC flow may have used response_mode=fragment or query, so we need to handle both cases.
let searchParams = parsedUrl.searchParams;
if (parsedUrl.hash.includes("=")) {