Authentication & Authorization

•
8
•

Implements modern authentication and authorization patterns including Auth.js v5, OAuth, JWT, and role-based access control.

This skill provides production-grade architectural guidance and code patterns for implementing secure authentication and authorization in modern web applications. It covers NextAuth.js/Auth.js v5 setup, OAuth providers (Google, GitHub), Credentials authentication with bcrypt, Prisma ORM schema modeling, session management, middleware route protection, server actions, and role-based or permission-based access control (RBAC). It is ideal for developers building secure login flows, user registration, and granular authorization layers in Next.js and full-stack React projects.

主要功能

01Secure Server Actions for user registration, login, and session validation
02Complete Auth.js (NextAuth.js v5) setup with Prisma adapter and TypeScript types
03Multi-provider authentication supporting Google, GitHub, and Credentials strategies
04Role-Based Access Control (RBAC) and granular permission authorization helpers
05Edge-compatible Next.js middleware for route protection and access control
068 GitHub stars

使用场景

01Restricting routes and API handlers using role-based or permission-based access control
02Configuring Prisma schemas and NextAuth callbacks for user sessions and JWT handling
03Setting up modern OAuth and email/password login flows in Next.js applications