auth

Implement authentication and access control for Next.js 15 and Supabase applications.

Updated Nov 10, 2025
One-click install
npx skills add https://github.com/BOM-98/FinTracker --skill auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth
Source: https://github.com/BOM-98/FinTracker/tree/main/.claude/skills/auth
Command: npx skills add https://github.com/BOM-98/FinTracker --skill auth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Implementing robust authentication and access control is inherently complex and prone to security vulnerabilities. This skill provides a standardized, secure, and multi-tenant ready authentication system for Next.js 15 + Supabase applications, eliminating common security pitfalls and development overhead.

Core Features & Use Cases

  • Comprehensive Auth: Handles login, logout, registration with email verification, and OAuth (GitHub) using Supabase's secure httpOnly cookie-based sessions.
  • Hybrid Route Protection: Secures Next.js Server Components and Server Actions with role-based access (Admin/Member) and multi-tenant family-based data isolation.
  • Data Privacy: Enforces strict data access with Row Level Security (RLS) policies, ensuring users only access their own family's data.
  • Use Case: Quickly implement an admin-only page that redirects unauthorized users, or secure a Server Action to ensure only members of a specific family can modify their data.

Quick Start

Protect the '/settings' route in a Next.js Server Component, redirecting unauthenticated users to '/login'.

Frequently Asked Questions about auth

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

FAQPage Schema
How do I implement authentication and access control in Next.js with Supabase?

Authentication and access control in Next.js 15 + Supabase uses httpOnly cookie-based sessions managed via Supabase Auth. The Skill provides server-side token validation, middleware token refresh, and role-based route protection for Server Components and Server Actions, plus multi-tenant data isolation with Row Level Security policies.

How do I protect Next.js Server Components and Server Actions from unauthorized access?

Protect Server Components and Server Actions using built-in authorization checks that validate user tokens via supabase.auth.getUser() and enforce role-based access rules. The Skill supplies requireAuth, requireAdmin, and requireFamilyAccess helpers to redirect unauthenticated or unauthorized users.

Can I use Supabase for multi-tenant authentication with family-based data isolation?

Yes. Supabase supports multi-tenant family-based data isolation through Row Level Security policies that restrict data access by family ID. The Skill implements admin and member role enforcement across Server Components, Server Actions, and route handlers to enforce tenant boundaries.

What authentication methods does this support besides email and password?

The Skill supports email and password login, email-verified registration, and OAuth via GitHub, all using Supabase's secure httpOnly cookie-based session handling. Token validation and refresh occur server-side for both traditional and OAuth flows.

How do I set up an admin-only page that redirects unauthorized users?

Use the requireAdmin authorization check in your Next.js Server Component or route handler to verify admin role membership. Unauthorized users are redirected to a specified fallback route; the Skill handles token validation and role enforcement automatically.