Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GetUser method that supports a JWT. #39

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

AlexMeesters
Copy link
Contributor

What kind of change does this PR introduce?

Adds a GetUser method with a JWT parameter. Using this to verify a user on a back end service.
Reasoning for adding it is based on this issue: supabase/supabase#147
Whereas you can do this in javascript:

const { data: user, error } = await supabase.auth.api.getUser(token)

What is the current behavior?

Currently the API is not exposing the method to fetch user data using a JWT.
I've added this method so it is exposed to the client. So it can be used on backend services to validate JWT's.

What is the new behavior?

Method in Client that allows you to fetch the user using GetUser(jwt).
Called like so:

var getUser = await client.GetUser(jwt);

Additional context

No further context. Feel free to ask questions or explain to me a better way to solve my problem if there is any.

@acupofjose
Copy link
Contributor

Wonderful, thanks for this! I’ll push it into the next release either this afternoon or tomorrow!

@acupofjose acupofjose merged commit d50e540 into supabase-community:master Oct 27, 2022
@acupofjose
Copy link
Contributor

Available in v2.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants