UNPKG

@brightlayer-ui/react-auth-workflow

Version:

Re-usable workflow components for Authentication and Registration within Eaton applications.

19 lines (18 loc) 756 B
import { JSX } from 'react'; type ReactRouterAuthGuardProps = { children?: JSX.Element; isAuthenticated: boolean; fallBackUrl: string; }; /** * Component that renders a conditional Route. If the user is not authenticated, this route * will redirect to the route specified by user using fallBackUrl prop. If the user is authenticated, it will render the provided * content. * @param children The element/route to render if the user is authenticated * @param isAuthenticated Indicates whether the user is authenticated or not * @param fallBackUrl URL where to redirect if user is not authenticated * * @category Component */ export declare const ReactRouterAuthGuard: (props: ReactRouterAuthGuardProps) => JSX.Element | null; export {};