Authentication Errors
Authentication errors appear in the browser console or API responses when PrimeCal cannot verify who you are (401 Unauthorized) or knows who you are but will not allow the action (403 Forbidden). This page explains each error code you are likely to encounter and how to resolve it.
HTTP 401 — Unauthorized
A 401 response means the request did not include a valid authentication token, or the token provided was rejected.
"Session expired. Please sign in again."
Backend message: tokenExpired
Why it happens: Your JWT access token has reached its expiry time. The automatic refresh attempt failed (usually because the refresh token itself has also expired).
Fix: Sign out and sign back in. A fresh token pair is issued on successful login.
No token present
Why it happens: The browser lost the stored token — this can happen after clearing localStorage, switching browsers, or a logout from another tab.
Fix: Sign in again. The token is stored in the browser's localStorage under the auth key.
Token validation failed (API key requests)
Why it happens: If you are using a personal API key to call PrimeCal endpoints, the key may have been deleted, regenerated, or revoked. The api_access feature must also be included in your plan.
Fix: Go to Settings → API Keys, check whether the key exists and is active. Regenerate if necessary.