Hypermedia

Social auth

20 steps 16 files 1 packages 1 dependencies

This pack adds social sign-in to your app. Provider buttons on your login and signup pages run an OAuth round-trip, and signed-in users get a connected-accounts area to link more providers or disconnect ones they no longer use.

  • Provider emails are trusted only when the provider verifies them, and an unverified one is routed through your existing email-verification flow.
  • An email that already belongs to a local account is refused rather than silently linked to the provider.
  • A password-less account cannot disconnect its last provider, so it can never lock itself out.
  • A "Last used" hint marks whichever method the visitor signed in with last.
Depends on Auth

This pack extends the auth pack's User model and reuses its email-verification flow. Apply the auth pack first.

Apply the social auth pack with Flow. Start a new session in your selected coding agent and execute the following slash command inside it.

$ claude
> /flow.apply social-auth

After applying, Flow will make the following changes to your app.

  • Reuse your account settings area to host the connected accounts, or establish a minimal profile page when you have none.

  • Land the backend as shipped, from the social_identities migration and the nullable-password change through the withSocialIdentity() model mixin, the OAuth redirect and callback controller, the disconnect controller, and the routes.

  • Configure the providers you pick, Google and GitHub by default, wire the "Last used" hint into your login and signup, and add the two-factor branch when your app already has two-factor.

  • Restyle the provider buttons on your login and signup pages and the connected-accounts section to your design system.

  • Run the tests, then walk the sign-in, connect, and disconnect flow and show you the result.

Terms & License Agreement