docs: clarify AUTH_COOKIE_DOMAIN usage for cross-subdomain authentication and update related documentation
This commit is contained in:
@@ -19,7 +19,8 @@ export const getSessionData = async (cookies: Cookies): Promise<App.Locals | nul
|
||||
console.log('locals', locals);
|
||||
if (!locals) return null;
|
||||
|
||||
locals.fromSessions = !!cookies.get('classroomio.session_data');
|
||||
// This will always be true because if we don't have classroomio cookies, we won't be able to this line of code.
|
||||
locals.fromSessions = true;
|
||||
|
||||
return locals;
|
||||
} catch (error) {
|
||||
|
||||
@@ -114,7 +114,7 @@ Use `./run-docker-full-stack.sh --no-minio` to exclude MinIO if you do not need
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` | Google OAuth |
|
||||
| `AUTH_COOKIE_DOMAIN` | Railway: dashboard domain when API/dashboard use different subdomains. Docker: optional (falls back to `DASHBOARD_ORIGIN`) |
|
||||
| `AUTH_COOKIE_DOMAIN` | Root domain for cross-subdomain cookies (e.g. `.yourdomain.com`) |
|
||||
| `PRIVATE_APP_HOST`, `PRIVATE_APP_SUBDOMAINS` | Multi-subdomain routing |
|
||||
| `UNSPLASH_API_KEY` | Unsplash image search |
|
||||
| `LICENSE_KEY` | Enterprise features (SSO, token-auth, no-tracking) |
|
||||
@@ -191,8 +191,8 @@ AUTH_BEARER_TOKEN="some-key"
|
||||
PRIVATE_SERVER_KEY="same-key-for-api-and-dashboard"
|
||||
PUBLIC_IS_SELFHOSTED="true"
|
||||
|
||||
# Required for auth cookies when API and dashboard use different subdomains — set to your dashboard domain, e.g. app.yourdomain.com
|
||||
AUTH_COOKIE_DOMAIN="app.yourdomain.com"
|
||||
# Required for auth cookies when API and dashboard use different subdomains — set to your root domain, e.g. yourdomain.com
|
||||
AUTH_COOKIE_DOMAIN="yourdomain.com"
|
||||
|
||||
# Email (configure one)
|
||||
SMTP_HOST=
|
||||
@@ -210,7 +210,7 @@ CLOUDFLARE_IMAGE_BUCKET_DOMAIN=
|
||||
```
|
||||
|
||||
<Callout type="warn" title="AUTH_COOKIE_DOMAIN (Railway)">
|
||||
When API and dashboard use different subdomains, set `AUTH_COOKIE_DOMAIN` to your dashboard domain (e.g. `app.yourdomain.com`). Without it, Better Auth cookies will not be set and login will fail. Docker self-hosting falls back to `DASHBOARD_ORIGIN` when this is absent.
|
||||
When API and dashboard use different subdomains, set `AUTH_COOKIE_DOMAIN` to your root domain (e.g. `yourdomain.com`). Without it, Better Auth cookies will not be set and login will fail.
|
||||
</Callout>
|
||||
|
||||
Optional: add `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` for OAuth, `UNSPLASH_API_KEY` for image search, or `LICENSE_KEY` for enterprise features.
|
||||
|
||||
Reference in New Issue
Block a user