Skip to content
Development
Command

/add-protected-route

Create a protected Next.js route with authentication enforcement.

From plugin
larouex-fullstack-builder
881 skills12 agents81 commands

Command definition

add-protected-route.md

Create a protected Next.js route with authentication enforcement.

Generate:

  • Protected page component with authentication check
  • Middleware for route protection (middleware.ts pattern)
  • Authentication state verification (server-side)
  • Redirect logic to login page with return URL
  • Loading state while checking authentication
  • Unauthorized access handling
  • TypeScript types for protected route props
  • Higher-order component or wrapper for route protection
  • API route protection with authentication middleware
  • Role-based access control (RBAC) if needed

Implement both page-level protection (Server Components) and API route protection. Include proper error handling, loading states, and redirect logic. Ensure protected routes work with SSR and Client Components.

@larouexnonprofitconsulting
Ships withlarouex-fullstack-builder

A comprehensive Claude Code plugin with 81 commands and 12 specialized AI agents for building modern, full-stack web applications with Next.js 15, Azure, Railway, Bootstrap, and TypeScript.

Stars on GitHub

Momentum

stars in total
8
Star history of LarouexNonprofitConsulting/larouex-fullstack-plugin on GitHub, a chart by star-history.com

Other commands on larouex-fullstack-builder.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command