Custom hook for handling authentication state and token validation.
An object containing:
Munir Mardinli
2025-06-06
// Basic usageconst { user, isLoading, error } = useAuthHook(); Copy
// Basic usageconst { user, isLoading, error } = useAuthHook();
// With TypeScript generics for custom user typeinterface CustomUser extends User<{ email: string }> {}const { user } = useAuthHook<CustomUser>(); Copy
// With TypeScript generics for custom user typeinterface CustomUser extends User<{ email: string }> {}const { user } = useAuthHook<CustomUser>();
Custom hook for handling authentication state and token validation.