UNPKG

@auth-kit/next

Version:

Next Js Plugin for React Auth Kit

38 lines (37 loc) 772 B
import type { ReactNode } from 'react'; /** * Component Props for Auth Outlet */ interface NextAuthProps { /** * Path to redirect if the user is not authenticated * * @example * `/login` */ fallbackPath: string; children: ReactNode; } /** * * Next Js Page Wrapper component. * * @param props - The Properties of the component * @returns - Compoent with React Auth Kit integrated * * @example * ```jsx * // layout.jsx * * export default function Layout({ * children, * }: { * children: React.ReactNode * }) { * return <NextAuth fallbackPath={'/login'}>{children}</NextAuth> * } * ``` * */ export default function NextAuth({ fallbackPath, children }: NextAuthProps): ReactNode; export {};