Overview
useSession hook is used to access the current session and user details from the SessionContext.Example Usage
session-component.tsx
Returns
Session | undefined
current session object.
Session type
() => void
function to log out the current user.
UserDetails | undefined
details of the currently signed-in user.
UserDetails type
boolean
boolean indicating whether the user is signed in.
boolean
boolean indicating whether the user details has been fetched.
boolean
boolean indicating whether the user details is loading.
boolean
boolean indicating whether an error occurred while fetching user details.
HttpError | Error | undefined
error object if an error occurred while fetching user details.