UNPKG

ai-auth

Version:

Complete Auth-Agent SDK - Agent authentication for AI developers + OAuth client integration for website developers

23 lines 790 B
/** * Protected Route components for Auth-Agent */ import React, { ReactNode, ComponentType } from 'react'; export interface ProtectedRouteProps { children: ReactNode; fallback?: ReactNode; onRedirect?: () => void; } /** * ProtectedRoute component * Only renders children if user is authenticated */ export declare function ProtectedRoute({ children, fallback, onRedirect }: ProtectedRouteProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null; /** * requireAuth HOC * Wraps a component to require authentication */ export declare function requireAuth<P extends object>(Component: ComponentType<P>, options?: { fallback?: ReactNode; onUnauthenticated?: () => void; }): ComponentType<P>; //# sourceMappingURL=ProtectedRoute.d.ts.map