fix: suppress expired-token log noise and redirect expired sessions to login #241

Merged
naomi merged 1 commits from fix/auth into main 2026-04-06 20:17:29 -07:00
Owner

Summary

  • Server: authMiddleware no longer calls logger.error for expired tokens — expiry is expected behaviour, not an error. Only tampered signatures and malformed tokens (genuinely suspicious) still log.
  • Client: fetchJson now handles 401 responses by clearing elysium_token and elysium_save_signature from localStorage and redirecting to /. Players whose 30-day token has expired will see the login page instead of a stuck "Invalid or expired token" error screen with no recovery path.

Closes #241

This PR was created with help from Hikari~ 🌸

## Summary - **Server**: `authMiddleware` no longer calls `logger.error` for expired tokens — expiry is expected behaviour, not an error. Only tampered signatures and malformed tokens (genuinely suspicious) still log. - **Client**: `fetchJson` now handles 401 responses by clearing `elysium_token` and `elysium_save_signature` from localStorage and redirecting to `/`. Players whose 30-day token has expired will see the login page instead of a stuck "Invalid or expired token" error screen with no recovery path. Closes #241 ✨ This PR was created with help from Hikari~ 🌸
hikari added 1 commit 2026-04-06 20:13:38 -07:00
fix: suppress expired-token log noise and redirect expired sessions to login
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m11s
CI / Lint, Build & Test (pull_request) Successful in 1m14s
d5284ff78c
- authMiddleware no longer logs token expiry as an error; only tampered
  or malformed tokens (genuinely suspicious) trigger logger.error
- fetchJson clears elysium_token and elysium_save_signature from
  localStorage and redirects to / on any 401, so players with expired
  sessions see the login page instead of a stuck error screen
naomi merged commit 2bc47b79aa into main 2026-04-06 20:17:29 -07:00
naomi deleted branch fix/auth 2026-04-06 20:17:29 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/elysium#241