Enhance authentication handling with secure cookie management

- Added support for configurable cookie security modes in the authentication logic, allowing for flexible handling of secure cookies based on the request scheme.
- Updated session management to respect the secure cookie flag based on the environment and request context.
- Modified the Fastify server setup to honor reverse proxy headers for improved cookie security in various deployment scenarios.
- Enhanced documentation in the codebase to clarify the new cookie security options and their implications.
This commit is contained in:
2026-08-03 15:14:39 +07:00
parent f2a4e8958c
commit a92e8e2775
3 changed files with 86 additions and 7 deletions
+5
View File
@@ -15,6 +15,11 @@ services:
# AUTH_PASSWORD: change-me
# SESSION_SECRET: long-random-string-at-least-32-chars
# SESSION_TTL_HOURS: "168"
# Cookie Secure: auto (default) follows http/https per request — use for WireGuard IP + public HTTPS.
# COOKIE_SECURE: auto
# Force: always | never (or true | false)
# Behind a TLS-terminating reverse proxy, keep TRUST_PROXY on so X-Forwarded-Proto is honored.
# TRUST_PROXY: "true"
volumes:
- ./data:/app/data
restart: unless-stopped