Complete authentication system with Better Auth, email verification, password reset, protected routes, and account management.
Install
npx skillscat add andrelandgraf/fullstackrecipes/authentication Install via the SkillsCat registry.
This skill implements a complete authentication system using Better Auth, including email verification, password resets, and account management. It solves the complexity of managing secure user sessions and protected routes. Developers should use this skill when building Next.js applications that require robust, type-safe user authentication and transactional email integration.
Authentication
Complete authentication system with Better Auth, email verification, password reset, protected routes, and account management.
Prerequisites
Complete these recipes first (in order):
Type-Safe Environment Configuration
Type-safe environment variable validation using Zod with a Drizzle-like schema API. Supports server/public fields, feature flags, either-or constraints, and client-side protection.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/config-schema-setupNeon + Drizzle Setup
Connect a Next.js app to Neon Postgres using Drizzle ORM with optimized connection pooling for Vercel serverless functions.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/neon-drizzle-setupNext.js on Vercel
Create a Next.js app running on Bun, configure the development environment, and deploy to Vercel with automatic deployments on push.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/nextjs-on-vercelShadcn UI & Theming
Add Shadcn UI components with dark mode support using next-themes. Includes theme provider and CSS variables configuration.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/shadcn-ui-setupCookbook - Complete These Recipes in Order
Resend Setup
Configure Resend for transactional emails like password resets and email verification.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/resend-setupBetter Auth Setup
Add user authentication using Better Auth with Drizzle ORM and Neon Postgres. Base setup with email/password authentication.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/better-auth-setupBetter Auth Emails
Add email verification, password reset, and account management emails to Better Auth using Resend.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/better-auth-emailsBetter Auth Components
Add UI components and pages for authentication flows including sign in, sign up, forgot password, reset password, and email verification.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/better-auth-componentsBetter Auth Profile & Account
Add a complete account settings page with profile editing, password changes, email updates, session management, and account deletion.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/better-auth-profileBetter Auth Protected Routes
Add server-side route protection to enforce authentication on specific pages while keeping others public.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/better-auth-protected-routesWorking with Authentication
Use Better Auth for client and server-side authentication. Covers session access, protected routes, sign in/out, and fetching user data.
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/using-authentication