Speed up uds-auth login: paint badge first, lazy /api/me.

Skip startup /api/me until QR load, stop blocking me on workspace provision, and register the footer login entry before heavy ACL gates so login appears immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-12 12:29:49 +08:00
parent 1c461285fc
commit 81ff8eb19f
4 changed files with 104 additions and 134 deletions

View file

@ -21,7 +21,7 @@ export function directRequest(url, opts = {}) {
if (body && headers['Content-Length'] == null && headers['content-length'] == null) {
headers['Content-Length'] = body.length
}
const timeoutMs = opts.timeoutMs ?? 8000
const timeoutMs = opts.timeoutMs ?? 3000
// Fresh Agent — never inherit globalAgent (often patched by proxy bootstraps).
const agent = new lib.Agent({ keepAlive: false })
@ -71,7 +71,7 @@ export async function searchUserByEmpNoToken({
empNoHeader = 'X-Emp-No',
authValueHeader = 'X-Auth-Value',
origin,
timeoutMs = 8000,
timeoutMs = 3000,
}) {
if (!userSearchUrl || !empNo || !token) {
return { ok: false, reason: 'missing_args' }