mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
Improve auth hook security: restructure URL classification to fix /_web/* bypass when requireAuth is active, use HMAC-SHA256 for constant- time token comparison, remove dead webModeEnabled code. Improve frontend auth flow: extract initializeApp() with watch-based re-init after login, add getToken callback for real-time store reads, unify SSE 401 handling via fetchWithAuth, switch default storage to sessionStorage, add router guard consuming meta.public. Add "Remember this device" checkbox on login page with dual localStorage/sessionStorage strategy and safety warning. Add 23 unit tests for auth hook matrix and http client. Co-authored-by: Cursor <cursoragent@cursor.com>