fec-route-protection

Implement client-side route protection and RBAC across React Router, Next.js, Vue Router, and Nuxt.

21|3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/bovinphang/frontend-craft --skill fec-route-protection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fec-route-protection
Source: https://github.com/bovinphang/frontend-craft/tree/main/skills/fec-route-protection
Command: npx skills add https://github.com/bovinphang/frontend-craft --skill fec-route-protection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use to implement and review frontend route protection, including login state handling, redirects, and RBAC across React Router, Next.js, Vue Router, and Nuxt.

Core Features & Use Cases

  • Unified client-side access control across multiple frameworks (React Router, Next.js middleware, Vue Router, Nuxt) to prevent unauthorized access and reduce flickering.
  • RBAC and permissions gates embedded in route guards, redirects on login or insufficient permissions, and consistent session handling.
  • Use Case: Protect admin dashboards or tenant-scoped pages with predictable navigation behavior.

Quick Start

Define a ProtectedRoute component and global guards to enforce authentication and permissions across your app.

Frequently Asked Questions about fec-route-protection

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

FAQPage Schema
How do I implement route protection with RBAC in Next.js middleware?

Frontend route protection uses client-side guards and middleware to verify authentication and permissions before rendering routes. RBAC gates block unauthorized access, handle redirects after login, and ensure consistent session handling across protected pages.

How do I prevent page flickering during client-side authentication checks in React Router?

Preventing page flickering in React Router involves applying global route guards to verify authentication state before rendering components. This ensures predictable navigation behavior and redirects unauthenticated users without displaying protected content.

Does this approach to route protection work with both Vue Router and Nuxt?

Yes, this route protection approach supports unified client-side access control across Vue Router and Nuxt. It applies consistent permission gates, login redirects, and session handling across modern frontend frameworks to prevent unauthorized access.

What is the best way to handle multi-tenant route protection and permission-based gating?

The best way to handle multi-tenant route protection is embedding RBAC permissions directly into frontend route guards. This secures tenant-scoped pages and admin dashboards with predictable redirects while maintaining server-side authorization as the security boundary.

Do I need server-side authorization if I already have frontend route guards?

Yes, server-side authorization remains the ultimate security boundary even with frontend route guards. Client-side RBAC and login state handling only prevent unauthorized access visually and reduce flickering, but server validation is still required.