Agent skill
nuxt-auth
Authentication with Laravel Sanctum and permission-based authorization. Use when implementing login/logout, protecting pages with permissions, checking permissions in components, or understanding the auth flow.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/design/nuxt-auth-leeovery-claude-nuxt-fabe5da5
SKILL.md
Nuxt Authentication & Authorization
Laravel Sanctum authentication with permission-based access control.
Core Concepts
auth.md - Complete auth patterns, permissions, page protection
Sanctum Setup
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-auth-sanctum'],
sanctum: {
baseUrl: process.env.NUXT_PUBLIC_API_URL,
endpoints: {
login: '/auth/login',
user: '/auth/user',
csrf: '/sanctum/csrf-cookie',
logout: '/auth/logout',
},
redirect: {
onAuthOnly: '/auth/login',
onGuestOnly: '/',
},
},
})
Auth Composable
const { user, isAuthenticated, login, logout, init } = useSanctumAuth()
// Login
await login({ email, password })
// Logout
await logout()
// Check auth
if (isAuthenticated.value) { /* ... */ }
Permission Checking
const { can, cannot } = usePermissions()
// Single permission
if (can('leads.create')) { /* ... */ }
// In templates
<UButton v-if="can('leads.create')" @click="createLead">Create</UButton>
Page Protection
definePageMeta({
permissions: 'leads.list',
})
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?