refactor(frontend): zentrales Cookie-Handling + fetch2-Konventionstest #309
No reviewers
Labels
No labels
component/backend
component/docs
component/e2e
component/frontend
component/infra
component/keycloak
prio/high
prio/low
prio/medium
type/bug
type/chore
type/feature
type/refactor
type/test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
WompSchmiede/FamilienFeierPlaner!309
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/centralize-cookie-handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allgemein
Altes Verhalten
Cookie-Operationen (setzen/lesen/loeschen von 12 verschiedenen Cookies) waren auf 10+ Dateien verteilt mit duplizierten Option-Konstanten (path, httpOnly, sameSite, secure, maxAge) und Magic Strings.
Neues Verhalten
$lib/config/cookies.ts: COOKIE_NAMES, Option-Presets (SESSION_COOKIE, CLIENT_COOKIE, SESS_CLEAR, CONSENT_SET, ...), MAX_AGES, SESSION_COOKIE_NAMES, OAUTH_COOKIE_NAMES$lib/utils/client-cookie.ts: getCookie/setCookie/deleteCookie (einzige Stelle mit document.cookie)$lib/utils/server-cookie.ts: setSessionTokens/clearSession/setUserInfo/setOauthFlow/clearOauthFlow (alle event.cookies-Operationen)fetch2-convention.test.ts: scanntsrc/routes/und faengt jedes barefetch(in Server-Routen (ausser+page.server.ts,+layout.server.ts,.svelte, BFF-Proxy)strict(bisher teilweiselax)session_expires_atwird bei Refresh-Failure in hooks.server.ts jetzt korrekt mitgeloeschtBegruendung
Vermeidung von Duplikation, konsistente Cookie-Optionen, automatische Erkennung von
fetch2-Verstossen.Test-Hinweise
cd frontend && npm run test— 1227 Tests, 74 Filescd frontend && npm run lint— 0 errorsfetch2manuell auffetchzurueckgesetzt → Test schlaegt an