Skip to content

app/: GitHub sign-in at today's URLs, with the waitlist (sc-8900) - #52

Merged
ndbroadbent merged 2 commits into
mainfrom
laravel-sign-in
Dec 2, 2026
Merged

ndbroadbent merged 2 commits into
mainfrom
laravel-sign-in

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Sign-in for the Laravel Rust app (sc-8900, the auth side), stacked on #51. Same URLs as today's server, so the web app's links keep working.

  • Users have no password or remember token, as the coordinator asked. Everyone signs in with a forge.
    • User implements Authenticatable by hand (no password hash, no remember token).
    • A Users provider of our own finds users by ID and never by a login name.
    • The scaffold's password and remember_token columns are gone.
  • GET /auth/{forge}?return_to=… goes off to GitHub through Laravel's social login. The return address must be a path on this site.
  • GET /auth/{forge}/callback:
    • It takes the profile from social login, then reads GitHub's /user/emails (every verified address) and /user/installations (each repository the person can reach through the GitHub App, with their permission), as today's server does.
    • It finds the person by their GitHub ID, else the signed-in user when they asked to link (POST /auth/{forge}/link), else an account with one of their verified addresses. Otherwise it makes an account.
    • With VISUALCI_WAITLIST=true, someone new gets a waitlist row and the one-line page instead of an account.
  • Events, the seam with the domain side:
    • SignedUp { user_id, via } on a new account: the domain side gives it its own organization.
    • SignedIn { user_id, forge, site, repositories } on every sign-in: memberships follow the repositories. That listener comes when the domain tables land.
  • GET /auth/session says whether this browser is signed in. POST /auth/logout ends the session.
  • forge:: holds the forge-neutral types (kinds, permissions, repository URLs, identities), ported as they are. forge::github holds the sign-in's API calls.
  • GitLab sign-in comes next, as a custom provider for social login.

Tests (app/tests/sign_in.rs, with social login and GitHub's API faked):

  • a new person gets an account and goes back where they started, signed in;
  • a returning person is found by their GitHub ID;
  • an existing account is found by a verified email;
  • an unsafe return address is ignored;
  • an unknown forge gets a 404;
  • with sign-ups closed, someone new gets the waitlist row and page with no session, and someone with an account still signs in.

All 11 app tests pass. Clippy and fmt are clean.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #201 · 331 unchanged · no changes

This PR vs base: nothing since #193, across 2 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent changed the base branch from laravel-auth to main December 2, 2026 12:58
…o=, /auth/{forge}/callback, /auth/{forge}/link, /auth/session and /auth/logout at today's URLs; Laravel's social login plus GitHub's API for every verified email and the installations' repositories; finds the person by identity, the signed-in user when linking, or a verified email, else makes an account (SignedUp) or, with VISUALCI_WAITLIST=true, a waitlist row and one line; SignedIn carries the repositories for memberships; users have no password or remember token (a provider of our own); forge types ported
…and ID (a GitHub and a GitLab ID can be the same number); a test that a cross-site POST to /auth/logout is refused (Laravel's web-group CSRF check: 419) while the app's own works
@ndbroadbent
ndbroadbent merged commit a2ffb80 into main Dec 2, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-sign-in branch December 2, 2026 13:14
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.

1 participant