fix(auth): add JWT__RefreshKey config and env var fallback in JwtService

- Add JWT__RefreshKey to .env.example with documentation
- Add JWT__RefreshKey to docker-compose.yml and docker-compose.prod.yml
- Fix JwtService to check both IConfiguration and env vars (JWT__REFRESHKEY)
  for access token key and refresh token key, matching Program.cs pattern
- Fixes 'Jwt:RefreshKey is not configured' 500 error on register/login
This commit is contained in:
Arnaud Dartois committed 2026-07-25 18:02:43 +00:00
1 parent f6fbc082a1
commit 810900cd3e
4 files changed
+22 -8

No files matched your search

+3
View File
@@ -8,7 +8,10 @@
DATABASE_URL=Host=postgresql;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall
# JWT (change in production!)
# JWT__Key is used for access tokens, JWT__RefreshKey for refresh tokens.
# Both must be at least 32 bytes (256 bits) — use different values for security.
JWT__KEY=ChangeMeToAtLeast32BytesLongKeyInProd!
JWT__REFRESHKEY=ChangeMeToAtLeast32BytesRefreshKeyInProd!
JWT__ISSUER=heimdall
JWT__AUDIENCE=heimdall-api