Skip to content

Um repositório avançado dedicado à autenticação construído com as mais modernas tecnologias web.

Notifications You must be signed in to change notification settings

WesleyR10/Next-Auth-V5

Repository files navigation

Next Auth v5 - Advanced Repository (2024)

image

This is a repository for Next Auth v5 (2024)

This project contains the following main 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)

For the env file use this template:

# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL=""
DIRECT_URL=""

# NextAuth
AUTH_SECRET=""
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# Resend Mail
RESEND_API_KEY=

NEXT_PUBLIC_APP_URL=""

About

Um repositório avançado dedicado à autenticação construído com as mais modernas tecnologias web.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published