-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Description
Nuxt Auth Sanctum is not only responsible for login/logout flows, but also acts as a global HTTP authentication layer for all API traffic (GET, POST, PUT, DELETE, etc.) using Laravel Sanctum.
Currently, while authentication errors such as 401 Unauthorized are handled correctly, HTTP 503 Service Unavailable responses are not treated as a first-class scenario.
As a result, when the backend API is in maintenance mode or temporarily unavailable, the application does not provide a consistent or user-friendly response.
Problem
-
The library handles all authenticated HTTP requests, not just login
-
Backend may return 503 Service Unavailable for:
-
maintenance mode
-
deployments
-
infrastructure issues
-
-
The frontend does not have a centralized mechanism to react to 503 responses
-
This can lead to confusing UI states or repeated failed requests
Expected Behavior
When any API request returns HTTP 503, the application should:
-
immediately stop normal request handling
-
redirect the user to a e.g
/maintenancepage -
optionally prevent further API calls until the service is available again
Why This Is Needed
-
503 is a global service-level error, not an auth error
-
Handling it centrally improves:
-
user experience
-
error consistency across all HTTP methods
-
system resilience during maintenance windows
-
-
Avoids misusing authentication flows for availability problems