authentication
Installation
SKILL.md
Authentication
Quick Start
When working with authentication:
- Use
auth()from@/lib/authto get current session - Verify roles before admin operations
- Use middleware for route protection
- Never store tokens in localStorage (use httpOnly cookies)
- Validate JWT tokens in API routes
Key Files
auth.ts- NextAuth.js configurationsrc/lib/auth/- Auth utilitiesmiddleware.ts- Route protectionsrc/app/api/auth/- Auth API routes