Skip to content

Group papers ask pre-group and expired sessions to sign in again - #18

Merged
irashack-products[bot] merged 1 commit into
mainfrom
group-signin
Nov 24, 2026
Merged

irashack-products[bot] merged 1 commit into
mainfrom
group-signin

Conversation

@irashack-products

Copy link
Copy Markdown
Contributor

What and why

Fixes #17. A session from before group readers has no recorded groups, so a group paper answered it with a bare 404. Signing out and back in fixed it, but nothing told the reader so.

  • Migration 022_groups_checked.sql adds sessions.groups_checked. Sign-in sets it when it asks for the groups scope. Older sessions, and sessions from a configuration without group readers, read as unchecked.
  • An unchecked session is now treated like one whose group membership has expired. It keeps its own paper. /p/{paper}/… for any paper a group of its issuer reads answers with the sign-in page ("Sign in again to read this paper."), and the sign-in link carries next. With no paper of its own, the session is asked to sign in at once.
  • Expired sessions get the same sign-in page for any group paper of their issuer, not only papers they read before. Only the papers they read before appear in the switcher.
  • /login?next= only accepts a same-site /p/{paper}/… path (no other origin, no ..). After the callback, the reader lands back on that page.
  • A session whose current, recorded groups don't include the paper still gets 404, as do papers no group reads and unknown ids. Configurations without group readers are unchanged.

How tested

  • go test ./..., go vet ./..., gofmt -l ., node --test web/sw_test.js
  • New tests:
    • TestUncheckedGroupsAskForSignIn (auth): unchecked, other issuer, checked without the paper, expired, no group readers.
    • TestPreGroupSessionSignsInAgain (reader): the 401 page with next, unrelated papers still 404, the round trip back to the paper, a checked non-member still 404.
    • TestReturnPath.

Checklist

  • go test ./... passes
  • gofmt -l . is clean
  • Regenerated schemas and OpenAPI when those files were touched (none touched)

🤖 Generated with Claude Code

@irashack-products
irashack-products Bot merged commit a6d047d into main Nov 24, 2026
2 checks passed
@irashack-products
irashack-products Bot deleted the group-signin branch November 24, 2026 13:31
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.

Group papers 404 for sessions that signed in before group readers

0 participants