-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue: Configure Cross-Subdomain Cookie Sharing for Authentication
Status: To Do
Context: Vue (CF Pages) and DRF (Server) are on different subdomains (atlas-api.gcers.org and atlas.gcers.org). Backend set-cookie should set browser cookies, and when frontend request backend, browser should automatically bring sessionid cookie, which is used in drf user authentication.
Further configs should be made to enable correct cookie implementation between cross-subdomain.
1. Backend Configuration (Django/DRF)
- Update
settings.py:SESSION_COOKIE_DOMAIN = ".gcers.org"(Allows subdomains to access the cookie).CORS_ALLOWED_ORIGINS(Whitelist frontend origin) (already implemented).CORS_ALLOW_CREDENTIALS = True(Required for browser to accept cross-origin cookies).
- Custom Cookies: Ensure
temp_tokenis set withdomain=".gcers.org".
2. Frontend Configuration (Vue)
- Note: Ensure During deployment
VITE_API_BASE_URLuses the absolute URL (https://atlas-api.gcers.org).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Todo