unauthenticated
- Returned as
- The problem's code
- HTTP status
- 401 Unauthorized
- type
https://zautha.com/docs/errors/unauthenticated
When it happens
Section titled “When it happens”- Backend API: the
Authorization: Bearer sk_…header is missing, or the secret key is not a key of any instance (mistyped, deleted or revoked). - Frontend API: the request needs a signed-in session and the browser has none (it signed out, or the session ended or expired).
- Your own backend:
@zautha/nextjs,@zautha/backendandZautha.AspNetCoreanswer a protected API route with this code when the request has no valid session token. They write the same body Zautha does.
What to do
Section titled “What to do”On the server, send the instance’s current secret key from the dashboard (API keys). In the browser, ask the user to sign in again; the SDK clears its state when the session is gone.