mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-16 19:00:47 +08:00
Stop infinite page refresh from auth remount gates.
Remove directory-flow reload, only shadow the picker while anonymous, and stop clearing login attrs on AuthBadge unmount so flat↔workspace observers cannot loop. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ab926969f6
commit
060500360d
2 changed files with 9 additions and 28 deletions
|
|
@ -1123,12 +1123,8 @@ function reloadAfterLogin() {
|
||||||
clearSessionIfAnonymous(window.__udsAuthSessions)
|
clearSessionIfAnonymous(window.__udsAuthSessions)
|
||||||
try { softReconnectAuth() } catch { /* ignore */ }
|
try { softReconnectAuth() } catch { /* ignore */ }
|
||||||
}
|
}
|
||||||
return () => {
|
// Do not reset auth attrs in the effect cleanup: React remount/strict-mode
|
||||||
// Keep locked while remounting; do not leave attrs missing (CSS/click lock needs "0").
|
// would briefly look logged-out and trigger flat↔workspace reload loops.
|
||||||
document.documentElement.setAttribute('data-uds-logged-in', '0')
|
|
||||||
document.documentElement.setAttribute('data-uds-can-settings', '0')
|
|
||||||
document.documentElement.setAttribute('data-uds-can-create-ws', '0')
|
|
||||||
}
|
|
||||||
}, [user]) /* uds-auth: logout-reconnect-on-null */
|
}, [user]) /* uds-auth: logout-reconnect-on-null */
|
||||||
|
|
||||||
const stopQr = useCallback(() => {
|
const stopQr = useCallback(() => {
|
||||||
|
|
@ -1828,31 +1824,16 @@ function reloadAfterLogin() {
|
||||||
}
|
}
|
||||||
disposers = []
|
disposers = []
|
||||||
}
|
}
|
||||||
// Deny folder pick until AuthBadge proves canCreateWorkspace. Occupying the
|
// Only shadow directoryFlow while anonymous. Logged-in users (including
|
||||||
// directoryFlow hole with a null Gate shadows the native/browse picker; when
|
// non-creators) keep the native/browse occupant so "Add workspace" still
|
||||||
// permission later becomes true we must reload once so the real occupant
|
// renders; CSS + RPC + Host ACL deny create for users without permission.
|
||||||
// rebinds — otherwise "Add workspace" never renders (empty hole).
|
// Never location.reload() here — remount attr flips caused infinite refresh.
|
||||||
const sync = () => {
|
const sync = () => {
|
||||||
const ready = document.documentElement.getAttribute('data-uds-auth-ready') === '1'
|
const loggedIn = document.documentElement.getAttribute('data-uds-logged-in') === '1'
|
||||||
const canCreate = document.documentElement.getAttribute('data-uds-can-create-ws') === '1'
|
if (loggedIn) {
|
||||||
if (!ready) {
|
|
||||||
installGate()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (canCreate) {
|
|
||||||
const stolen = disposers.length > 0
|
|
||||||
clearGate()
|
clearGate()
|
||||||
if (stolen) {
|
|
||||||
try {
|
|
||||||
if (!window.sessionStorage.getItem('uds-auth-dirflow-reloaded')) {
|
|
||||||
window.sessionStorage.setItem('uds-auth-dirflow-reloaded', '1')
|
|
||||||
window.location.reload()
|
|
||||||
}
|
|
||||||
} catch { /* ignore */ }
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try { window.sessionStorage.removeItem('uds-auth-dirflow-reloaded') } catch { /* ignore */ }
|
|
||||||
installGate()
|
installGate()
|
||||||
}
|
}
|
||||||
const injectOffs = [
|
const injectOffs = [
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "uds-auth",
|
"name": "uds-auth",
|
||||||
"version": "0.2.5",
|
"version": "0.2.6",
|
||||||
"description": "UDS authentication plugin for DeepSeek Harness with multi-tenant session isolation",
|
"description": "UDS authentication plugin for DeepSeek Harness with multi-tenant session isolation",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue