• Steven's avatar
    fix(web): skip GetCurrentUser on init when no token is stored · 4aaebc50
    Steven authored
    When no token exists in sessionStorage, AuthContext.initialize() was
    still calling GetCurrentUser, triggering the auth interceptor to attempt
    RefreshToken and retry — producing a burst of 5+ auth API calls in under
    a second that reverse proxies with rate limiting (e.g. CrowdSec) flag as
    brute force.
    
    Add hasStoredToken() to auth-state and bail out of initialize() early
    when there is definitively no session to restore. The refresh flow for
    expired tokens is preserved since hasStoredToken() checks for presence
    regardless of expiry.
    
    Fixes #5647
    4aaebc50
Name
Last commit
Last update
.github Loading commit data...
cmd/memos Loading commit data...
internal Loading commit data...
plugin Loading commit data...
proto Loading commit data...
scripts Loading commit data...
server Loading commit data...
store Loading commit data...
web Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
.golangci.yaml Loading commit data...
AGENTS.md Loading commit data...
CODEOWNERS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
go.mod Loading commit data...
go.sum Loading commit data...