UNPKG

@narangcia-oss/cryptic-auth-client-react

Version:

React hooks and components for cryptic-auth authentication with seamless OAuth2 integration

30 lines 887 B
import { ReactNode } from "react"; export interface AuthGuardProps { /** * Content to render when user is authenticated */ children: ReactNode; /** * Content to render when user is not authenticated */ fallback?: ReactNode; /** * Content to render while checking authentication status */ loading?: ReactNode; /** * Whether to redirect to login page when not authenticated * @default false */ redirect?: boolean; /** * URL to redirect to when not authenticated * @default '/login' */ redirectTo?: string; } /** * Component that conditionally renders content based on authentication status */ export declare function AuthGuard({ children, fallback, loading, redirect, redirectTo, }: AuthGuardProps): import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=AuthGuard.d.ts.map