@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Interface ProtectedRouteProps

    Props for the ProtectedRoute component.

    interface ProtectedRouteProps {
        children: ReactNode;
        loadingComponent?: ReactNode;
        redirectTo?: string;
        roles?: string[];
        unauthenticatedComponent?: ReactNode;
        unauthorizedComponent?: ReactNode;
    }
    Index

    Properties

    children: ReactNode
    loadingComponent?: ReactNode

    Custom loading component

    redirectTo?: string

    Where to redirect if not authenticated. Default: renders fallback.

    roles?: string[]

    Required role(s). If set, user must have one of these roles.

    unauthenticatedComponent?: ReactNode

    Custom unauthenticated component (not logged in)

    unauthorizedComponent?: ReactNode

    Custom unauthorized component (wrong role)