Skip to main content
The useAuth() hook provides access to the current user’s authentication state.

Returns

An object with the following properties:
boolean
A boolean indicating whether the authentication state is still being loaded.
User | null
The User object of the currently authenticated user, or null if the user is not authenticated.
boolean
A boolean indicating whether the user is authenticated.
function
A function that can be called to initiate the login process.
function
A function that can be called to initiate the logout process.

Examples