Git Product home page Git Product logo

next-auth-v5-advanced-guide's Introduction

Next Auth v5 - Advanced Guide (2024)

image

This is a repository for Next Auth v5 - Advanced Guide (2024)

VIDEO TUTORIAL

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
  • ๐Ÿ‘ฅ 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)

Prerequisites

Node version 18.7.x

Cloning the repository

git clone https://github.com/AntonioErdeljac/next-auth-v5-advanced-guide.git

Install packages

npm i

Setup .env file

DATABASE_URL=
DIRECT_URL=

AUTH_SECRET=

GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

RESEND_API_KEY=

NEXT_PUBLIC_APP_URL=

Setup Prisma

npx prisma generate
npx prisma db push

Start the app

npm run dev

Available commands

Running commands with npm npm run [command]

command description
dev Starts a development instance of the app

next-auth-v5-advanced-guide's People

Contributors

antonioerdeljac avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.