auth-handler
Protect Next.js Auth Routes
Authentication changes often fail when teams mix session APIs and route guards. This skill guides Claude, Codex, and Claude Code toward the project helpers for secure access control.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "auth-handler" from https://skillstore.io/skills/aayushbaniya2006-auth-handler.md and its manifest at https://skillstore.io/api/skills/aayushbaniya2006-auth-handler/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "auth-handler". A new API route returns account data without an explicit route guard.
Expected outcome:
The route should use the standard authenticated wrapper. The existing response logic can stay inside the protected handler.
Using "auth-handler". A client component reads the session through the unsupported NextAuth hook.
Expected outcome:
The component should use the project user hook. This keeps client data access consistent with the application architecture.
Using "auth-handler". A scheduled endpoint accepts cron requests without the project cron helper.
Expected outcome:
The endpoint should use the cron authentication helper. Middleware alone is not enough for this background job path.
Security Audit
SafeAll static findings are false positives caused by Markdown backticks and section headings in documentation. No prompt injection, malicious intent, command execution, or network reconnaissance evidence was found in the reviewed files.
Risk Factors
⚙️ External commands (9)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/aayushbaniya2006-auth-handler/audits/9?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/aayushbaniya2006-auth-handler?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/aayushbaniya2006-auth-handler?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/aayushbaniya2006-auth-handler/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/aayushbaniya2006-auth-handler.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA · BibTeX · CFF)
APA citation
AayushBaniya2006. (2026). auth-handler security audit report (audit version 9) [Author version unspecified]. Skillstore. https://skillstore.io/skills/aayushbaniya2006-auth-handler/audits/9BibTeX citation
@techreport{aayushbaniya2006-aayushbaniya2006-auth-handler-2026,
author = {AayushBaniya2006},
title = {auth-handler security audit report (audit version 9)},
institution = {Skillstore},
year = {2026},
number = {9},
url = {https://skillstore.io/skills/aayushbaniya2006-auth-handler/audits/9},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "auth-handler security audit report (audit version 9)"
version: "unspecified"
type: report
authors:
- name: "AayushBaniya2006"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/aayushbaniya2006-auth-handler/audits/9"
identifiers:
- type: other
value: "skillstore:aayushbaniya2006-auth-handler:audit:9"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Protect API Endpoints
Add the correct authentication wrapper to new or existing API routes.
Load Current User Data
Use the approved client or server access pattern for user session data.
Audit Auth Consistency
Check whether routes, cron jobs, and admin paths follow the project auth conventions.
Try These Prompts
Review this API route and apply the correct project authentication wrapper. Keep the existing handler behavior unchanged.
Check this component or server function for user session access. Replace unsupported session usage with the project-approved pattern.
Review this admin endpoint and ensure it uses the project super admin protection pattern. Explain any authorization assumptions.
Audit these changed files for route protection, cron authentication, and user data access. List missing safeguards and propose focused fixes.
Best Practices
- Protect each sensitive route with the matching project helper, even when middleware already exists.
- Use the project user hook in client components and the project auth import on the server.
- Check auth provider settings, user schema changes, and required environment values during auth work.
Avoid
- Do not rely only on global middleware for sensitive API routes.
- Do not use unsupported session hooks when the project provides its own user hook.
- Do not assume minimal session data includes plan or authorization details.
Frequently Asked Questions
What kind of project is this skill for?
Can it create a new auth system?
Which routes does it cover?
Does it support client user data access?
Does it check secrets or provider credentials?
Can Claude Code and Codex use it?
Developer Details
Author
AayushBaniya2006License
MIT
Skillstore revision
r1
Version notice
The author did not declare a version.
Ref
c1fdca50ff516318f65fed0d7f9e82797c5171dc
Maintenance freshness
7/18/2026
Usage
5 downloads · 216 views
File structure
📄 SKILL.md