Repository navigation
Description
What happened?
frontend/src/app/app.module.ts configures JwtModule.forRoot with disallowedRoutes: ["forum/api/users"], so every other request — including the anonymous pre-login config fetch — carries the localStorage JWT as Authorization: Bearer … whenever one is present.
/api/config/pre-login is @PermitAll by definition (returns flags needed to render the login page itself). When the stored token's signature can't be verified server-side — which happens after a backend signing-key rotation, manual localStorage tampering, or cross-deployment cookie bleed — the eager JwtAuthFilter from PR #5404 returns 401 + error="invalid_token" to the pre-login request.
GuiConfigService.loadPreLogin runs inside APP_INITIALIZER and has no retry on failure, so the entire SPA session is stuck without the config flags (localLogin, googleLogin, …) that the login form depends on. The login page renders without its form until the user manually reloads the tab.
The footgun is the auto-attach of Authorization to an endpoint that is by definition anonymous, not the backend's 401 policy.
How to reproduce?
- Open the app and inspect localStorage in DevTools.
- Set
access_tokento any JWT-shaped string whose header / payload decode but whose signature fails server-side verification — e.g.localStorage.setItem("access_token", "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ4IiwidXNlcklkIjoxLCJyb2xlIjoiQURNSU4iLCJleHAiOjk5OTk5OTk5OTl9.bogus"). - Navigate to any route that triggers a full app bootstrap (e.g. open
http://localhost:4200/aboutin a new tab). - Observe: backend log shows
GET /api/config/pre-loginreturning401. The page header and "About" copy render but the login form (Sign In / Sign Up tabs, Username, Password inputs) is missing. - Manually reload the tab — the interceptor's earlier logout cleared localStorage, so the second bootstrap fires pre-login anonymously, gets
200, and the form appears.
Branch
main
Commit Hash (Optional)
749798d (after PR #5392; the eager-401 backend in PR #5404 makes the regression user-visible but the root cause is the front-end auto-attach)
What browsers are you seeing the problem on?
- Chrome / Chromium (verified via Playwright)
Relevant log output
INFO org.eclipse.jetty.server.RequestLog: [0:0:0:0:0:0:0:1] - "GET /api/config/pre-login HTTP/1.1" 401
WARN org.apache.texera.auth.JwtAuthFilter: Invalid JWT: Unable to parse token
ERROR Failed to load pre-login configuration: HttpErrorResponse
ERROR Failed to load GUI config during app init: Error: Failed to load pre-login configuration from backend: [object Object]
Activity
fix(frontend): exclude /api/config/pre-login from JwtModule (#5408)
fix(frontend): exclude /api/config/pre-login from JwtModule (apache#5408
fix(frontend): exclude /api/config/pre-login from JwtModule (apache#5408