@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.
12 lines (11 loc) • 440 B
TypeScript
export declare const useAuth: (redirectIfNotAuthenticated?: string) => {
user: import("..").User<unknown> | null;
isAuthenticated: boolean;
loading: boolean;
isLoaded: boolean;
getToken: () => Promise<string>;
loginError: Record<string, unknown> | null;
login: (credentials: import("..").LoginPayload) => Promise<void>;
logout: () => void;
socialLogin: (payload: import("..").SocialProvider) => void;
};