Skip to content
Back to skills

Auth

ASecurity

Adding authentication endpoints and managing auth state across the app. Trigger: when adding new auth-protected routes or API calls.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 26, 2026
ai-agentstypescriptshellbashreactdockerapi

Works with

  • api

Security analysis

A100/100

Scanned October 4, 2026

npx -y skills add JNZader/repoforge --skill auth --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Auth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Auth
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jnzader-auth-repoforge/badge)](https://www.skillsdirectory.com/skills/jnzader-auth-repoforge)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-auth-endpoint
description: >
  Adding authentication endpoints and managing auth state across the app.
  Trigger: when adding new auth-protected routes or API calls.
license: Apache-2.0
metadata:
  author: repoforge
  version: "1.0"
  complexity: low
  token_estimate: 450
  dependencies: []
  related_skills: []
  load_priority: high
---

<!-- L1:START -->
# add-auth-endpoint

One sentence: Adding authentication endpoints and managing auth state across the app.

**Trigger**: when adding new auth-protected routes or API calls.
<!-- L1:END -->

<!-- L2:START -->
## Quick Reference

| Task | Pattern |
|------|---------|
| Add auth provider | `<AuthProvider>` |
| Get auth state | `useAuth()` |
<!-- L2:END -->

<!-- L3:START -->
## Critical Patterns

### Use AuthProvider to wrap app

Wrap the app shell with `AuthProvider` to make `useAuth` available throughout the component tree.

```typescript
import { AuthProvider } from '@/lib/auth';

ReactDOM.createRoot(document.getElementById('root')!).render(
  <AuthProvider>
    <App />
  </AuthProvider>,
);
```

### Use useAuth to access context

Call `useAuth()` anywhere inside a provider-wrapped tree to get the auth context without prop-drilling.

```typescript
const { token, loading } = useAuth();
if (loading) return <LoadingSpinner />;
```

## When to Use

- Adding a new protected API route
- Checking auth state in a component
- Accessing user token globally

## Commands

```bash
docker build -t myapp .
docker run -p 3000:80 myapp
```

## Anti-Patterns

### Don't: Access auth outside AuthProvider

Calling `useAuth()` outside an `AuthProvider` boundary throws an error.

```typescript
const { token } = useAuth(); // BAD: throws 'useAuth must be used within an AuthProvider'
```
<!-- L3:END -->

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.