useAuth
Last updated
Last updated
useAuth
A custom React hook that manages user authentication and authorization.
This hook takes no arguments.
user
(User | null
): An object representing the authenticated user, or null
if no user is authenticated.
loading
(boolean
): A boolean indicating whether the hook is currently in the process of fetching data.
signIn
(({ hmac, email }: { hmac: any; email: any }) => Promise<void>
): A function that accepts an object with two properties, hmac
and email
, and returns a promise that resolves when the user is signed in.
signOut
(() => Promise<void>
): A function that returns a promise that resolves when the user is signed out.