Protected Content Example
This page demonstrates Auth0 authentication in Quartz. Only authenticated users with “admin” or “editor” roles can view this content.
Features Demonstrated
- Page-level Protection: This entire page requires authentication via the
auth: true
frontmatter property - Role-based Access: Only users with specific roles can view this content
- Seamless Integration: Authentication is handled transparently by Auth0
How It Works
The protection is configured in the frontmatter:
---
title: "Protected Content Example"
auth: true
roles: ["admin", "editor"]
---
Configuration Options
auth: true
- Enables authentication requirement for this pageroles: ["role1", "role2"]
- Optional array of required roles- If no roles are specified, any authenticated user can access the page
Next Steps
You can protect any page in your Quartz vault by adding the appropriate frontmatter. The Auth0 integration handles:
- User authentication
- Session management
- Role verification
- Automatic redirects
For partial content protection within a page, use the ProtectedContent
component.