UNPKG

@auth-kit/next

Version:

Next Js Plugin for React Auth Kit

24 lines (23 loc) 601 B
/** * React hook to implement the NextAuth feature * @returns - Authentication Ready state * * @remarks * Usage of this hook will make the page CSR, any SSR will not work in * private routes, as the private data is stored on the client side, * only CSR is available at this moment. * * @example * ```jsx * 'use client' * import { useAuth } from "@auth-kit/next/useAuth" * export default function Layout({ * children, * }: { * children: React.ReactNode * }) { * return useAuth({ fallbackPath: '/login'}) && children; * } * ``` */ export default function useNextAuth(): boolean;