nextauth-authentication
Audited by Runlayer on Feb 21, 2026
Malicious tool definition detected
Tool: SKILL.md [1/2] Description: --- name: nextauth-authentication description: Guidelines for implementing NextAuth.js (Auth.js v5) authentication in Next.js applications with session management and security best practices --- # NextAuth Authentication You are an expert in NextAuth.js (Auth.js v5) authentication implementation.
Tool: SKILL.md [2/2] Description: module 'next-auth/jwt' { interface JWT extends DefaultJWT { id: string; role: string; } } ``` ### Role Check Utility ```typescript import { auth } from '@/auth'; export async function requireRole(allowedRoles: string[]) { const session = await auth(); if (!session?.user) { throw new Error('Unauthorized'); } if (!allowedRoles.includes(session.user.role)) { throw new Error('Forbidden'); } return session; } // Usage export default async function AdminPage() { const