Skip to content

Sign up, sign in, and invite through better-auth #13

Description

@hammadmajid

Part of #3

Question

Bring better-auth into apps/server so sign up, sign in, and invite work end to end, with organisations as workspaces.

  • Install better-auth with the Drizzle adapter on D1 and the organisation plugin. Every sign in method that needs no password, as the research ticket found them.
  • Sign up creates the user, the workspace, and the owner membership. Invite creates a membership from a link.
  • Sessions per the glossary: thirty days, sliding, sign out everywhere.
  • Waitlist match at sign up: an email on the waitlist is marked as early bird, so the Polar discount can be attached later.
  • Polar plugin present but inert when its secrets are absent, which is what a self hosted instance is.
  • Mount it at /auth/* on the Worker, and fill rpc/base.ts's authed middleware so procedures can require a session; integration tests inside the Vitest pool against real D1.
  • Record the better-auth decision and the self hosted instance definition as ADRs once it runs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions