Skip to content

K13.4: sign-out ends every session - #138

Merged
MFrancis-dev merged 2 commits into
mainfrom
fix/revocable-sessions
Nov 8, 2026
Merged

MFrancis-dev merged 2 commits into
mainfrom
fix/revocable-sessions

Conversation

@MFrancis-dev

@MFrancis-dev MFrancis-dev commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Fix 3 from the pre-launch review (auth).

Problem: sign-out only cleared the cookie. A copied or stolen session token kept working for its full 7 days.

Fix:

  • Session tokens carry an issued-at time (older tokens derive it from their expiry)
  • DELETE /api/session sets users.sessions_valid_after (migration 0003, one nullable column)
  • requireUser and the demo routes reject sessions issued before it

Tests: route test signs in, signs out with the same cookie, checks it now gets 401, and that a fresh sign-in works. 138 total.

Also (separate commit): CI retries the cargo-near download and falls back to building it from crates.io, because GitHub's release downloads kept answering 504 and failing the contract job.

Docs: README status, ARCHITECTURE §4.1 and §5, ESSENTIALS, ROADMAP.

Closes #130

Sign-out only cleared the browser cookie, so a copied session token kept
working for 7 days.

Closes #130
@MFrancis-dev
MFrancis-dev merged commit 6dca2d6 into main Nov 8, 2026
4 checks passed
@MFrancis-dev
MFrancis-dev deleted the fix/revocable-sessions branch November 8, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

K13.4 Make sessions revocable

2 participants