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.
Examples
Get the logged in user with the current session
val user = supabase.gotrue.retrieveUserForCurrentSession(updateSession = true)
Get a user based on their access token
val user = supabase.gotrue.retrieveUser("JWT")