petalbid-frontend
    Preparing search index...
    • A component that wraps routes to protect them from unauthorized access.

      It performs the following checks:

      1. Shows a loading state while checking authentication status.
      2. If the user is not authenticated, it redirects to the login page.
      3. If allowedRoles are specified, it checks if the authenticated user has one of the required roles. If not, it displays a 403 Forbidden error page.
      4. If the user is authenticated and authorized, it renders the child components.

      Parameters

      Returns Element

      The child components, a redirect, a loading indicator, or an error page.