Back to Browse

Next Auth V5 - Advanced Guide (2024)

1.0M views
Dec 31, 2023
8:00:57

โญ Source code: https://cwa.run/next-auth Auth.js: https://authjs.dev/ Middleware config: https://dub.sh/Apr6dvD Resend: https://resend.com/ Node.js: https://nodejs.org/en ShadcnUI: https://ui.shadcn.com/ Clerk: https://dub.sh/SdVFxFU Learn how to add advanced authentication to your NextJS App. Key Features: - ๐Ÿ” Next-auth v5 (Auth.js) - ๐Ÿš€ Next.js 14 with server actions - ๐Ÿ”‘ Credentials Provider - ๐ŸŒ OAuth Provider (Social login with Google & GitHub) - ๐Ÿ”’ Forgot password functionality - โœ‰๏ธ Email verification - ๐Ÿ“ฑ Two factor verification (2FA) - ๐Ÿ‘ฅ User roles (Admin & User) - ๐Ÿ”“ Login component (Opens in redirect or modal) - ๐Ÿ“ Register component - ๐Ÿค” Forgot password component - โœ… Verification component - โš ๏ธ Error component - ๐Ÿ”˜ Login button - ๐Ÿšช Logout button - ๐Ÿšง Role Gate - ๐Ÿ” Exploring next.js middleware - ๐Ÿ“ˆ Extending & Exploring next-auth session - ๐Ÿ”„ Exploring next-auth callbacks - ๐Ÿ‘ค useCurrentUser hook - ๐Ÿ›‚ useRole hook - ๐Ÿง‘ currentUser utility - ๐Ÿ‘ฎ currentRole utility - ๐Ÿ–ฅ๏ธ Example with server component - ๐Ÿ’ป Example with client component - ๐Ÿ‘‘ Render content for admins using RoleGate component - ๐Ÿ›ก๏ธ Protect API Routes for admins only - ๐Ÿ” Protect Server Actions for admins only - ๐Ÿ“ง Change email with new verification in Settings page - ๐Ÿ”‘ Change password with old password confirmation in Settings page - ๐Ÿ”” Enable/disable two-factor auth in Settings page - ๐Ÿ”„ Change user role in Settings page (for development purposes only) Timestamps 00:00 Intro & Demo 02:05 Project setup 15:19 Routing crash course 38:06 Home page 48:40 Card wrapper 01:04:51 Login form 01:23:08 Register form 01:40:16 Database & Prisma setup 01:57:14 Create user 02:06:30 Middleware & Login 02:50:52 Callbacks 03:20:34 OAuth (Google & Github) 03:47:58 Resend (Sending emails) 04:19:27 Email verification 04:48:12 Reset password email 05:08:11 Reset password form 05:22:48 Two factor authentication 05:55:28 User button 06:15:02 Server & Client example 06:30:06 Admin example 06:47:25 Settings page 07:33:09 Sponsor demo 07:38:14 Deployment

Download

1 formats

Video Formats

360pmp4762.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Next Auth V5 - Advanced Guide (2024) | NatokHD