Back to docs

Documentation

Auth and account flow

Login, registration, verification, OAuth, guest sessions, and profile management.

Article
PreviousNext

The Next.js template keeps auth tokens out of browser-managed storage. Browser state may cache a safe user summary, but the backend session token belongs in the HttpOnly tenant cookie.

Supported entry points

  • /login and /auth/login
  • /auth/register
  • /auth/verify and /auth/verify-email
  • /auth/forgot-password and /auth/reset-password
  • /auth/callback for GitHub OAuth
  • guest login and /auth/guest-convert

Handlers that can receive a token from the backend should pass through authCookieJsonResponse. That removes token fields from the JSON response and sets the tenant cookie.

Server-side session

The dashboard layout resolves the session on the server: authenticated users render the dashboard, anonymous users redirect to /login with a redirect param, and an expired access token falls through to a client-side refresh before deciding.

Account surface

/dashboard/settings holds Profile (?tab=profile: profile updates, password changes, guest conversion prompts) and API keys (?tab=keys). Legacy /profile, /dashboard/profile and /dashboard/keys redirect there with their query.