useAuth
useAuth
useAuth
A custom React hook that manages user authentication and authorization.
Usage
Arguments
This hook takes no arguments.
Returns
user
(User | null
): An object representing the authenticated user, ornull
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
andemail
, 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.
Last updated
Was this helpful?