mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 00:43:18 +08:00
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>
22 lines
569 B
JavaScript
22 lines
569 B
JavaScript
/**
|
|
* 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
|
|
}
|