Kotlin: Retrieve a user
- This method gets the user object from the current session.
- Fetches the user object from the database instead of local session.
- Should be used only when you require the most current user data. For faster results,
getCurrentSessionOrNull()?.user
is recommended.
Parameters
jwt
(Required)The JWT token.
Examples
Get the logged in user with the current session
val user = supabase.auth.retrieveUserForCurrentSession(updateSession = true)
Get a user based on their access token
val user = supabase.auth.retrieveUser("JWT")