Skip to main content
This walks through the smallest working theauth-go server: an in-memory store, magic links, and email/password sign-in, wired to a chi router in a handful of lines.
Run it:
Sign up:
Or request a magic link:

Add Postgres storage

Replace memory.New() with the Postgres adapter for persistent sessions:

Mounted endpoints

a.Mount(r) wires the following routes: OAuth providers (GET /auth/providers/{name}/start and /callback): 12 built-in providers, including github, google, microsoft, discord, apple, facebook, slack, gitlab, bitbucket, twitch, linkedin, and x. See Add an OAuth Provider for the full list. WebAuthn: /auth/webauthn/register/{begin,finish}, /auth/webauthn/login/{begin,finish}, /auth/webauthn/credentials. TOTP: /auth/totp/enroll/{begin,finish}, /auth/totp/verify, /auth/totp/recovery, DELETE /auth/totp.

Next steps

Last modified on October 7, 2026