mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 08:30:45 +08:00
Show login progress immediately and stop auth 401 hangs.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
f92cb85a4a
commit
5bcaf7fd2d
10 changed files with 152 additions and 74 deletions
|
|
@ -218,6 +218,12 @@ async function apiPost(path, body) {
|
|||
data = null;
|
||||
}
|
||||
if (res.status === 401) {
|
||||
const isAuthEndpoint =
|
||||
url.includes("/admin/api/auth/login") || url.includes("/admin/api/auth/bootstrap");
|
||||
// Login/bootstrap must never hang on the never-resolving 401 sentinel.
|
||||
if (isAuthEndpoint) {
|
||||
return data && typeof data === "object" ? data : { ok: false, error: "unauthorized" };
|
||||
}
|
||||
scheduleReauthAfter401(url);
|
||||
return await _haltAfter401();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue