Authentication Management

Secure MutuaPIX login flows across Laravel Sanctum and Next.js.

Updated Oct 18, 2025
One-click install
npx skills add https://github.com/Lucasdoreac/mutuapix-workspace --skill authentication-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Authentication Management
Source: https://github.com/Lucasdoreac/mutuapix-workspace/tree/main/.claude/skills/authentication-management
Command: npx skills add https://github.com/Lucasdoreac/mutuapix-workspace --skill authentication-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill ensures the MutuaPIX authentication system is robust and secure, preventing critical vulnerabilities like mock mode exposure in production. It streamlines managing login flows, environment configurations, and CSRF token handling.

Core Features & Use Cases

  • Vulnerability Detection & Remediation: Identifies and provides fixes for insecure mock mode configurations (e.g., authStore initializing with mock users in production).
  • Comprehensive Deployment Checklist: Guides through backend and frontend deployment steps, including cache clearing and environment variable validation.
  • Use Case: Before deploying a new authentication feature, use this skill to verify all environment variables are correctly set, mock mode is disabled, and the login flow functions securely in production, avoiding accidental security breaches.

Quick Start

Example: Verify production environment variables on VPS

ssh [email protected] 'cat /var/www/mutuapix-frontend-production/.env.production | grep NODE_ENV'

Expected output: NEXT_PUBLIC_NODE_ENV=production

Frequently Asked Questions about Authentication Management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a Next.js and Laravel Sanctum authentication flow in production?

Secure your Next.js and Laravel Sanctum authentication by configuring backend Sanctum for stateful sessions, implementing CSRF token handling, managing JWT tokens, injecting Axios with proper headers on the frontend, and validating environment variables to disable mock mode in production.

What vulnerabilities can occur if mock mode authentication is left enabled in production?

Mock mode vulnerabilities expose your authentication system to unauthorized access when enabled in production. This skill identifies insecure configurations like authStore initializing with mock users and provides fixes to enforce secure, stateful sessions before deployment.

How do I verify my authentication environment variables are correctly set before deploying?

Use environment-based security validation to check that NODE_ENV, API endpoints, and authentication tokens are production-ready. This skill provides a deployment checklist including SSH commands to verify backend and frontend environment configuration across your VPS or hosting platform.

Can I use Axios injection with Laravel Sanctum for token management in Next.js?

Yes. This skill covers frontend Axios injection to automatically attach Sanctum tokens and CSRF headers to requests, enabling secure token management and stateful session handling between your Next.js client and Laravel Sanctum backend.

What's the best way to handle CSRF tokens when deploying a Sanctum authentication system?

Implement backend CSRF token generation and frontend CSRF handling as part of your Sanctum configuration. This skill guides you through the complete setup, including cache clearing and validation, to prevent CSRF vulnerabilities across your deployment.

Do I need to clear cache and redeploy when enabling production authentication with Sanctum and Next.js?

Yes. This skill includes a comprehensive deployment checklist that covers cache clearing on both backend and frontend, environment variable validation, and security checks to ensure your Sanctum and Next.js authentication layer functions securely in production without residual mock mode exposure.