Files
dsas-cca-backend-bun/engage-api/get-activity.ts
JamesFlare1212 73e953f579 fix(auth): distinguish 500 (cookie expired) from other 5xx (real outage)
KEY INSIGHT:
- 500 = cookie expiration (early signal, re-login immediately)
- 502/503/504 = real server outage (bad gateway, service unavailable, gateway timeout)

BEHAVIOR:
- On 500: throw AuthenticationError → immediate re-login
- On 502/503/504: preserve cache, don't re-login (server is down)
- On 401/403: throw AuthenticationError → re-login

This prevents unnecessary re-login attempts during actual server outages
while still handling cookie expiration immediately.
2026-04-11 11:43:35 -04:00

9.7 KiB