chore: sync upstream @ v2.17.0 — fixes frozen session-cookie expiry (all logins broken since 4 Jul) - #5
Merged
Conversation
Squash-import of upstream/main (120 commits, v2.11 -> v2.17.0).
Primary motivation: the previously deployed commit predates upstream
583e35c7 ("fix: ensures new expire on setSessionCookie", #2708). Before
that fix, `sessionCookieOptions` carried
expires: new Date(Date.now() + AUTH_SESSION_LIFETIME)
evaluated once at module import, and `setSessionCookie` passed those
options through unchanged with no `maxAge`. Every session cookie the
process ever issued therefore expired at (process start + 30 days) --
frozen at 2026-07-04T18:54:19Z for the deployment running since
2026-06-04. Browsers discarded the cookie on arrival, so all logins
(Google OAuth and email/password alike) silently failed from that date.
Also imported upstream's deletions, which the 2026-06-04 sync missed:
packages/eslint-config/, packages/prettier-config/, prettier.config.cjs,
.prettierignore, .eslintrc.cjs, .eslintignore, tsconfig.eslint.json,
packages/lib/server-only/document/send-completed-email.ts and the stale
embedding/authoring docs. DEVALOK_FORK_NOTES.md now documents the
read-tree import method so future syncs propagate deletions.
Fork CI guards re-applied to 13 workflows. Upstream deleted
issue-assignee-check.yml and pr-review-reminder.yml, so those rows are
dropped from the guarded list. Per-job audit confirms the only
intentionally open jobs remain ci.yml/build_docker and
codeql-analysis.yml/analyze.
Pending Prisma migrations (all additive, no drops):
20260525103410_add_signature_level_and_csc_tables
20260604143030_add_email_transports
20260616120000_add_cancelled_document_status
20260622120000_add_recipient_reminder_count
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DYNE3dT1E7bGHk8Y8joXMm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every login on sign.devalok.in has silently failed since 2026-07-04 18:54 UTC — Google OAuth and email/password alike. The symptom was "Google sign-in does nothing"; server logs were clean because nothing errored.
Deployed commit
bfade19apredates upstream583e35c7("fix: ensures new expire on setSessionCookie", #2708, 9 Jun — five days after our last sync). Before that fix:setSessionCookiepassed those options straight through with nomaxAge, so every session cookie the process issued carried the sameExpires— process start + 30 days. The container started 2026-06-04 18:54:19 UTC, so from 4 Jul onward every cookie arrived at the browser already expired and was discarded on the spot.Observable on the live instance before this change:
Identical
Expiresacross requests 12 seconds apart — frozen, not clock skew. The OAuth state cookies survived because they also setMax-Age(which wins per RFC 6265); the session cookie sets onlyexpires, so it had nothing to fall back on.Not an email or Google problem: Zeptomail SMTP authenticates and accepts sender + recipient, reset emails deliver to INBOX, and the Google OAuth client resolves to the account picker with the correct
redirect_uri.What
Squash-import of
upstream/main@7533016(v2.17.0) — 120 commits, v2.11 → v2.17.0.Also imports upstream's deletions, which the 2026-06-04 sync silently kept:
packages/eslint-config/,packages/prettier-config/,prettier.config.cjs,.prettierignore,.eslintrc.cjs,.eslintignore,tsconfig.eslint.json,packages/lib/server-only/document/send-completed-email.ts, and stale embedding/authoring docs.DEVALOK_FORK_NOTES.mdnow documents thegit read-tree -u --reset upstream/mainmethod, since a diff-based import does not propagate deletions.Migrations
4 pending, all additive — no
DROP TABLE/DROP COLUMN/TRUNCATE:20260525103410_add_signature_level_and_csc_tablesEnvelope.signatureLevel(default'SES'),CscCredential,CscSession20260604143030_add_email_transportsEmailTransportTypeenum,EmailTransporttable,emailTransportIdFKs20260616120000_add_cancelled_document_statusALTER TYPE "DocumentStatus" ADD VALUE 'CANCELLED'20260622120000_add_recipient_reminder_countRecipient.reminderCount(default 0)Volume backup
pre-v2.17-upstream-mergetaken before merge (1180 MB referenced) — this volume had no prior backups.Fork CI guards
Re-applied to 13 workflows. Upstream deleted
issue-assignee-check.ymlandpr-review-reminder.yml, so those rows are dropped from the guarded table. A per-job audit confirms the only intentionally open jobs remainci.yml/build_dockerandcodeql-analysis.yml/analyze.Follow-up (not in this PR)
NEXTAUTH_SECRETis the literal Documenso defaultsecret. Session cookies are HMAC-signed with it, so the signing key is public knowledge — anyone can forge a valid session for any user. Rotating next, in the same restart.postgres:password. Private-network-only today (no TCP proxy), but one accidental proxy from being open.EmailTransportarrives in this range; verify env-var SMTP still drives mail after deploy.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYNE3dT1E7bGHk8Y8joXMm