Hello everyone. I am looking to see if there is a mechanism to retrieve a user from a jwt access token. My use-case is that I want to have a client send the token to my BE, which it will then retrieve the user from this token.
CRamsan
10/11/2024, 3:48 AM
The documentation points to the option for "Fetch the user object using the access_token jwt", which points to this existing somewhere.
CRamsan
10/11/2024, 5:51 AM
Oh I found it. The function is
retrieveUser
from the Auth instance, not Auth.admin.
CRamsan
11/26/2024, 6:28 AM
Hello everyone! So back to this topic, I just realized that
retrieveUser
signs in the library to the JWT token. There is no equivalent from the admin library to go from JWT to user. Is anyone aware of any alternative?
j
Jan
11/26/2024, 3:13 PM
What do you mean by
> signs in the library
The
retrieveUser
method only calls the API and returns the user, at no point is the user saved
Code
c
CRamsan
11/27/2024, 3:07 AM
Thanks for sharing that. When I was testing I saw that my BE code, was somehow signing as one of my users. I am thinking that it may be related to running two projects at the same time, both my client and BE code. For the JVM target, where are the information regarding the session stored?
And once again, thanks for clarifying my question. You are the hero in all of this.
as a delegate
The key, under which the session is stored, is determined by the Supabase URL. So unless that changed, it will point to the same value. You can however set the key yourself: