relay-companion 0.1.97 → 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/overlay/main.cjs +11 -2
  2. package/package.json +1 -1
package/overlay/main.cjs CHANGED
@@ -460,10 +460,14 @@ function accountInfo() {
460
460
  // hosts present NO certificate — the handshake fails outright, so a signed-out
461
461
  // user hitting /app/setup was bounced to a page no browser can load. /sign-in
462
462
  // renders through the proxy and carries the user on to setup afterwards.
463
- setupPath: "/sign-in?redirect_url=%2Fapp%2Fsetup",
463
+ // switch=1 is what makes this a SWITCH rather than a sign-in: the browser
464
+ // that runs this almost always still holds the old session, and without the
465
+ // flag the page treats that session as success and returns the pairing code
466
+ // for the very account the user was trying to leave.
467
+ setupPath: SETUP_PATH,
464
468
  // Shown in the pill so the flow is not trapped in whichever browser the OS
465
469
  // considers default (the session usually lives in a different one).
466
- setupUrl: absoluteUrl("/sign-in?redirect_url=%2Fapp%2Fsetup"),
470
+ setupUrl: absoluteUrl(SETUP_PATH),
467
471
  };
468
472
  }
469
473
 
@@ -556,6 +560,11 @@ async function signOutAccount() {
556
560
  }
557
561
 
558
562
  // Turn an actionUrl (absolute https, or a relative path) into an absolute URL.
563
+ // The one destination "Switch account" may use. Kept as a constant so the path
564
+ // and the copyable URL can never drift apart, and so the regression test has a
565
+ // single thing to assert against.
566
+ const SETUP_PATH = "/sign-in?switch=1&redirect_url=%2Fapp%2Fsetup";
567
+
559
568
  function absoluteUrl(pathOrUrl) {
560
569
  const value = String(pathOrUrl || "").trim();
561
570
  if (!value) return webBase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relay-companion",
3
- "version": "0.1.97",
3
+ "version": "0.1.98",
4
4
  "description": "Relay companion for ordinary messages, with dormant coordination features available only by explicit opt-in.",
5
5
  "type": "module",
6
6
  "bin": {