BlogApril 17, 2025Create password protected pages
To enable password protection for specific pages, add the page paths you want to protect to the protectedRoutes object in the resources/config.js file.
The RouteGuard component will automatically handle access control for these pages, requiring password authentication before allowing access.
The code above will ensure that the /work/once-ui page is only accessible after providing a password.
The password can be set in the .env.local file for local development and as an environment variable for production.