Better Auth Protected Routes
ListedSecure API routes with robust authentication and authorization checks, preventing unauthorized access.
Install on your platform
Showing Claude Code. One command installs this skill into any of the agents below.
- 1
Run this in your project
terminal$ npx skills add andrelandgraf/fullstackrecipes --skill better-auth-protected-routes -a claude-code Uses the open-source
skillsCLI and needs Node.js. Add-gto install it for your user instead of this project.
What we know about this skill
Publisher
andrelandgraf
Taken from the source listing. We haven't verified who controls this account.
Install target
Live repository
Not pinned. Installing fetches whatever the repository holds at the time you run the command.
Automated safety checks
This skill failed 1 of 6 checks. A failure is not proof of bad intent; it means something in the code needs a human to look at it before you run it.
No undeclared network calls: failed
Contacts 1 host that is neither well-known infrastructure nor declared in the skill's frontmatter: fullstackrecipes.com.
Every host the skill dials — from its scripts, its config endpoints or the commands it tells the agent to run — is either well-known package and API infrastructure or declared in its own frontmatter. Links in documentation are not counted.
Hosts contacted
fullstackrecipes.comundeclaredWhat it found
- .agents/skills/better-auth-protected-routes/SKILL.md:11contacts fullstackrecipes.com
curl https://fullstackrecipes.com/recipes/better-auth-protected-routes.md
Declares what it does: passed
SKILL.md parses and declares a name and a description.
SKILL.md exists, its frontmatter parses, and it declares a name and a description.
No obfuscated payloads: passed
No encoded or obfuscated payloads.
No base64, hex or compressed blob is decoded and then executed, and no encoded shell commands.
No credential access: passed
Reads no keys, tokens, keychains or credential files.
Neither the code nor the SKILL.md instructions read SSH keys, cloud credentials, keychains, token stores, browser cookie databases or dotfiles that hold secrets.
No pipe-to-shell installers: passed
No pipe-to-shell or download-and-run installers.
No `curl … | sh` pattern, in the code or in the instructions, that runs code fetched at run time.
Pinned to a commit: passed
Scanned andrelandgraf/fullstackrecipes at 4449331ed5.
The exact upstream commit SHA that was scanned is recorded, so the result refers to specific bytes.
- Commit
- 4449331ed5
- Scanned
- 1 file, 11 lines
About this skill
What it does
This skill secures API endpoints in Next.js applications by automatically verifying authentication tokens before allowing access to protected routes. It integrates directly with the better-auth library to handle session validation and user identity checks without manual implementation.
When to use it
- You are building a Next.js application that requires secure, private API endpoints.
- You want to offload complex authentication logic from your main application code.
- Your project already utilizes the
better-authlibrary for user management. - You need to prevent unauthorized access to sensitive data or administrative functions.
Key capabilities
- Automatically validates incoming requests against active user sessions.
- Blocks unauthenticated users from accessing specific route handlers.
- Reduces boilerplate code required for manual token verification.
- Ensures consistent security policies across the entire application.
Example prompts
- "Secure my Next.js API routes using better-auth to ensure only logged-in users can access them."
- "How do I implement protected endpoints in a full-stack recipe using better-auth?"
- "Create a secure route handler that verifies the user's session before returning data."
Tips & gotchas
Ensure you have better-auth correctly installed and configured in your project before applying this skill, as it relies on existing session infrastructure. This approach is specifically designed for Next.js environments; using it with other frameworks may require significant adaptation or will not function as intended.