UNPKG

@auth-kit/next

Version:

Next Js Plugin for React Auth Kit

40 lines (39 loc) 884 B
import type { ReactNode } from 'react'; /** * Component Props for Auth Outlet */ interface NextAuthProps { /** * Path to redirect if the user is not authenticated * * @deprecated Use AuthProvider fallbackPath prop instead. * Will be removed in the upcoming version * @example * `/login` */ fallbackPath?: string; children: ReactNode; } /** * * Next.js Page Wrapper component. * * @param props - The Properties of the component * @returns - Component 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 {};