Skip to content

Recipes

Complete, copy-paste patterns adapted from a production app. Each one is a runnable file, tested with the library.

Recipe What it builds
Sessions and API tokens a web app and its API on the same routes
Personal access tokens users create, list and revoke their own tokens
Role-gated routes admin-only endpoints from one validator
Sign out everywhere a device list with per-session revocation
Two-factor login TOTP codes, a pending-login cookie and recovery codes
Sign in with OpenID Connect "Log in with Google / Keycloak / Entra"
WebSocket tickets authenticating browser WebSockets without cookies
Audit your routes a CI test that fails on unguarded routes