mirror of
https://github.com/navidrome/navidrome.git
synced 2026-06-02 07:01:36 +00:00
When using externalized authentication (reverse proxy with Authentik, Authelia, etc.), expired proxy sessions cause CORS-blocked redirects that surface as TypeErrors instead of HTTP 401s. The existing checkError only handled status === 401, so these network errors were shown as vague "NetworkError" notifications instead of triggering re-authentication. Enhanced checkError to detect network errors when extAuthLogoutURL is configured and reload the page to let the proxy redirect to the auth provider. A sessionStorage-based 30-second guard prevents infinite reload loops. Also extracted an isNetworkError helper to deduplicate the detection logic already present in the login method. Added missing removeItem to the localStorage mock in setupTests, and added comprehensive tests for the new checkError behavior.