mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-14 00:43:28 +08:00
Bridge uds-auth session identity for Desktop dsh-app://.
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:
parent
92a6827aef
commit
5b5c0a1418
9 changed files with 686 additions and 51 deletions
22
uds-auth/lib/identity-cache.js
Normal file
22
uds-auth/lib/identity-cache.js
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue