Bridge uds-auth session identity for Desktop dsh-app://.
Some checks are pending
ci / test (push) Waiting to run
ci / test-postgresql (push) Waiting to run

Cookie-less Desktop needs localStorage bridge headers/WS params plus ALS enterWith and identity cache so login and history stay authenticated.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-09 22:46:37 +08:00
parent 92a6827aef
commit 5b5c0a1418
9 changed files with 686 additions and 51 deletions

View file

@ -0,0 +1,22 @@
/**
* Last verified browser identity (bridge or cookie).
* Desktop mux follow/history often runs with empty ALS; fall back here after
* a successful /uds-auth HTTP auth or WS upgrade bind.
*/
/** @type {object|null} */
let lastBrowserIdentity = null
export function rememberBrowserIdentity(identity) {
const emp = identity?.empNo || identity?.userContext?.empNo
if (!emp) return
lastBrowserIdentity = identity
}
export function clearBrowserIdentity() {
lastBrowserIdentity = null
}
export function peekBrowserIdentity() {
return lastBrowserIdentity
}