mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 15:08:47 -07:00
fix(auth): encrypt stored cookie keys; tighten the link and sign-out flows
- Data-protection keys are encrypted (AES-256-GCM, key derived from the server secret) before they reach the DataProtectionKeys table. - /link only follows local return paths and keeps the form when a signed-in visitor has an identity waiting to be linked. - A failed sign-out says so instead of reloading as if it worked.
This commit is contained in:
+4
-1
@@ -497,7 +497,10 @@ above.
|
||||
|
||||
Sessions are HttpOnly cookies per host (`dorknet_session`, 30 days, sliding).
|
||||
The keys that encrypt them are stored in the database (`DataProtectionKeys`),
|
||||
so redeploys and extra replicas keep everyone signed in. Unlinking the
|
||||
so redeploys and extra replicas keep everyone signed in. They're stored
|
||||
encrypted with a key derived from the server secret (`DORKNET_JWT_SECRET`),
|
||||
so a database backup alone can't forge sessions; changing that secret signs
|
||||
everyone out. Unlinking the
|
||||
identity, deleting the account or banning the player ends the session on the
|
||||
next request. Wrong passwords on the link form are limited to 5 per 15
|
||||
minutes per provider identity and per username.
|
||||
|
||||
Reference in New Issue
Block a user