feat(auth): configure Spring Session JDBC (fa_session, 8h idle, SameSite=strict)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-17 19:18:28 +02:00
parent 865c6ed796
commit 8c7a2741b0
2 changed files with 18 additions and 0 deletions

View File

@@ -1,6 +1,11 @@
spring:
jpa:
show-sql: true
session:
cookie:
# Dev runs over HTTP (port 5173 → 8080); Secure=true would prevent the
# cookie from being sent on plain HTTP. Override to false for local dev only.
secure: false
springdoc:
api-docs:

View File

@@ -38,6 +38,19 @@ spring:
starttls:
enable: true
spring:
session:
store-type: jdbc
timeout: 28800s # 8 h idle timeout (MaxInactiveIntervalInSeconds)
jdbc:
initialize-schema: never # Flyway owns schema creation (V67)
cookie:
name: fa_session
same-site: strict
http-only: true
# secure: true is the default when forward-headers-strategy detects HTTPS behind Caddy.
# application-dev.yaml overrides this to false for local HTTP dev.
server:
# Behind Caddy/reverse proxy: trust X-Forwarded-{Proto,For,Host} so that
# request.getScheme(), redirect URLs, and Spring Session "Secure" cookies