Skip to content

aiskillstore/marketplace / skills/aayushbaniya2006/auth-handler

auth-handler

Verified

Manage authentication, authorization, and user sessions. Use when dealing with login, sign-up, API protection, middleware, or user data fetching.

FileKindSize
SKILL.mdskill md1.0 KB
reference.mdmarkdown786 B
skill-report.jsonconfig16.5 KB

reference.md

View on GitHub
# Auth Architecture Reference

## Key Files
- **Config**: `src/auth.ts` (NextAuth v5, Providers, Adapter)
- **Schema**: `src/db/schema/user.ts`
- **Middleware**: `src/proxy.ts` (Route protection)

## Helpers
- `src/lib/auth/withAuthRequired.ts`
- `src/lib/auth/withSuperAdminAuthRequired.ts`
- `src/lib/auth/cronAuthRequired.ts`
- `src/lib/users/useUser.ts` (Frontend hook)

## Best Practices
1. **Defense in Depth**: Middleware (`proxy.ts`) is the first layer, but route wrappers are mandatory.
2. **Database**: Update `src/db/schema/user.ts` for user model changes.
3. **Environment**: Check `AUTH_SECRET`, `GOOGLE_CLIENT_ID`, `SUPER_ADMIN_EMAILS`.

## Common Tasks
- **Debugging Login**: Check providers in `auth.ts`.
- **Impersonation**: Supported via custom Credentials provider.

receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall