feat(auth): Redis-backed OIDC sessions for portal + operator
ci / typecheck (map[dir:apps/operator name:operator]) (push) Successful in 19s
ci / typecheck (map[dir:apps/booking name:booking]) (push) Successful in 22s
ci / typecheck (map[dir:apps/website name:website]) (push) Successful in 23s
ci / typecheck (map[dir:apps/portal name:portal]) (push) Successful in 28s
ci / typecheck (map[dir:services/platform-api name:platform-api]) (push) Successful in 23s
ci / test (push) Successful in 31s
ci / build (map[dir:apps/booking name:booking]) (push) Successful in 9s
ci / build (map[dir:apps/operator name:operator]) (push) Successful in 43s
ci / build (map[dir:services/platform-api name:platform-api]) (push) Successful in 5s
ci / build (map[dir:apps/portal name:portal]) (push) Successful in 51s
ci / deploy (push) Failing after 3m42s

nuxt-oidc-auth persists sessions via useStorage('oidc'), whose default
mount is per-pod memory — broken at >1 replica (random 401s) and every
deploy logged all users out. A nitro plugin now mounts 'oidc' on the
dezky-data Redis (db 1, app-prefixed keys, 14d TTL) when SESSION_REDIS_URL
is set; dev keeps the memory driver with no Redis required. Replicas back
to 2 for both apps.
This commit is contained in:
Ronni Baslund
2026-06-10 18:48:16 +02:00
parent fd0c5d011b
commit 91134c94f5
9 changed files with 135 additions and 96 deletions
@@ -13,11 +13,9 @@ metadata:
app.kubernetes.io/name: operator
app.kubernetes.io/part-of: dezky
spec:
# Single replica until OIDC sessions move to shared storage: nuxt-oidc-auth
# keeps sessions in per-pod memory, so with >1 replica every request that
# lands on the pod that did NOT handle the login gets 401. TODO: nitro
# session storage on the dezky-data Redis, then scale back up.
replicas: 1
# Sessions live on the dezky-data Redis (server/plugins/session-storage.ts,
# SESSION_REDIS_URL from the app secret) — safe to run multiple replicas.
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: operator