fec-route-protection

Installation
SKILL.md

#Route protection

Purpose

Establish clear authentication, authorization and redirection boundaries for front-end applications to avoid unauthorized access and flickering rendering.

When to Use

  • The page needs to be logged in to access, or different roles can see different routes.
  • Requires implementing route guards for React Router, Next.js, Nuxt or Vue Router.
  • Login expiration, insufficient permissions, and organization/tenant switching need to be handled uniformly.
  • Not used to replace server-side authorization; front-end routing protection can only improve the experience and cannot be used as the only security boundary.

Procedure

1. Define authentication and authorization status

export type AuthStatus = "loading" | "anonymous" | "authenticated";
Installs
6
GitHub Stars
23
First Seen
May 25, 2026