Hooks (client-side)
useAuth()
The useAuth()
hook provides access to the current user’s authentication state.
Returns
An object with the following properties:
A boolean indicating whether the authentication state is still being loaded.
The User object of the currently authenticated user, or null
if the user is not authenticated.
A boolean indicating whether the user is authenticated.
A function that can be called to initiate the login process.
A function that can be called to initiate the logout process.