Framework
A sign-in request changes which account a browser will use. The login origin policy checks where that request came from. Use this reference when your login interface and application live on different origins and you need to allow the intended pairing.
The staff and customer portal sign-in flows check the browser request origin before issuing session cookies. This protects sessions against unwanted cross-site sign-in.
The routes that issue a session from a request body therefore reject cross-site browser requests
with 403 { ok: false, error } before they read the body:
| Route | Session cookies |
|---|---|
POST /api/auth/login | auth_token, session_token |
POST /api/auth/session/refresh | auth_token |
POST /api/customer_accounts/login | customer_auth_token, customer_session_token |
POST /api/customer_accounts/magic-link/verify | customer_auth_token, customer_session_token |
POST /api/customer_accounts/invitations/accept | customer_auth_token, customer_session_token |
The sign-in routes reject cross-site browser requests and check the configured origin when needed. The first-party sign-in pages use same-origin requests. Keep trusted origins explicit and review rejection logs when a legitimate hostname stops working.
Configuration only matters for requests that reach step 3: browsers that send no Fetch Metadata,
and same-site requests from a sibling subdomain. For those, make sure the origin is recognised:
APP_URL=https://admin.example.com
APP_ALLOWED_ORIGINS=https://ops.example.com
Alternatively, let the reverse proxy forward X-Forwarded-Host (and X-Forwarded-Proto).
A sign-in form on a sibling subdomain (for example www.example.com posting to
app.example.com) works once its origin is listed in APP_ALLOWED_ORIGINS.
APP_ALLOWED_ORIGINS cannot re-enable a sign-in form hosted on a different site. The browser marks
that request Sec-Fetch-Site: cross-site, which is always rejected. Sign in on the application's
own origin, or call the API from a server.