Commit fb99cfe
fix(session): derive COOKIE_SESSION_SECRET from PLACE_SERVER_SECRET
When COOKIE_SESSION_SECRET is unset the service generated an ephemeral
per-boot key, so sessions did not survive a restart and did not match
across replicas — the PlaceOS platform does not provide that env var
(the Ruby auth used SECRET_KEY_BASE), so a real deployment logs every
user out on each redeploy and fails intermittently behind >1 replica.
Fall back to a stable key derived (SHA-256, namespaced) from
PLACE_SERVER_SECRET, which the platform always provides and which is
identical across restarts and replicas — so sessions persist with no
new deployment config. Ephemeral generation remains only when neither
secret is set (a bare dev box).
Verified in a local platform stack: a session issued before an auth
container restart is still accepted afterwards.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 7883020 commit fb99cfe
1 file changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| |||
0 commit comments