This skill should be used when the user asks about "authentication in Next.js", "NextAuth", "Auth.js", "middleware auth", "protected routes", "session management", "JWT", "login flow", or needs guidance on implementing authentication and authorization in Next.js applications.
68
55%
Does it follow best practices?
Impact
90%
1.40xAverage score across 3 eval scenarios
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.trae/skills/auth-patterns/SKILL.mdNextAuth v5 setup and RBAC configuration
Beta package version
0%
50%
Auth exports pattern
0%
100%
Correct route handler path
100%
100%
Route exports from handlers
25%
100%
Middleware auth export
0%
37%
SessionProvider wrapper
62%
75%
Client useSession hook
100%
100%
Server action sign-in/out
0%
100%
Type declaration file
100%
100%
JWT and session callbacks
100%
100%
AUTH_SECRET env var
0%
100%
Unauthorized redirect for wrong role
55%
100%
Middleware JWT verification and route protection
jose library used
100%
100%
TextEncoder secret
100%
100%
HS256 algorithm specified
100%
100%
x-user-id header
100%
100%
x-user-role header
100%
100%
callbackUrl on redirect
33%
100%
Cookie deletion on invalid token
100%
100%
Auth route redirect
100%
100%
Matcher excludes static assets
100%
100%
X-Frame-Options header
100%
100%
X-Content-Type-Options header
100%
100%
Referrer-Policy header
100%
100%
Custom session management and secure cookies
nanoid for session IDs
0%
100%
httpOnly cookie flag
100%
100%
Conditional secure flag
100%
100%
sameSite lax
100%
100%
path '/'
100%
100%
1-day refresh threshold
0%
100%
7-day session duration
0%
100%
Atomic token rotation
100%
100%
bcrypt cost factor 12
100%
100%
HS256 JWT algorithm
0%
0%
7-day JWT expiry
0%
0%
3069d33
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.