@inertiapixel/nextjs-auth
Version:
Authentication system for Next.js. Supports credentials and social login, JWT token management, and lifecycle hooks — designed to integrate with nodejs-auth for full-stack MERN apps.
15 lines (14 loc) • 418 B
TypeScript
interface ProtectProps {
children: React.ReactNode;
loadingFallback?: React.ReactNode;
redirectTo?: string;
}
declare const Protect: ({ children, loadingFallback, redirectTo }: ProtectProps) => import("react/jsx-runtime").JSX.Element | null;
export default Protect;
/**
* ======USAGE=====
*
* <Protect loadingFallback={<p>Loading...</p>} redirectTo="/login">
* <Dashboard />
* </Protect>
*/