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

fix: add auth.jwt() function #484

Merged
merged 1 commit into from
May 31, 2022
Merged

fix: add auth.jwt() function #484

merged 1 commit into from
May 31, 2022

Conversation

kangmingtay
Copy link
Member

What kind of change does this PR introduce?

  • Add auth.jwt() function to return the user's jwt claims
  • Add comments to signal deprecating auth.email, auth.uid, auth.role and to use auth.jwt instead

@kangmingtay kangmingtay self-assigned this May 31, 2022
@kangmingtay kangmingtay force-pushed the km/add-jwt-function branch from bcc4ea3 to c5d3ba7 Compare May 31, 2022 21:38
@kangmingtay kangmingtay merged commit e22cbc7 into master May 31, 2022
@kangmingtay kangmingtay deleted the km/add-jwt-function branch May 31, 2022 23:29
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.6.31 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dshukertjr
Copy link
Member

Would auth.uid() be removed at some point after deprecation, or does existing project have access to auth.uid() indefinitely?

@kangmingtay
Copy link
Member Author

hmm yeah i think we've decided to not deprecate the auth.uid() function in view of convenience since doing auth.jwt()->>'sub'::uuid everytime is gonna be pretty annoying

will remove the comment to deprecate that function

cc @kiwicopple

@tvogel
Copy link

tvogel commented Oct 3, 2024

The deprecation notice on auth.uid() still seems to be there and was confusing me today. And I very much agree that having a short-hand for that is worth it. Actually, I tend to think the same for auth.email() even though it's probably used a lot less. And I think, the deprecation notice for auth.role() should point to https://github.com/orgs/supabase/discussions/16703 because using auth.jwt() -> 'role' in RLS rules instead is not the intended effect of the deprecation.

uxodb pushed a commit to uxodb/auth that referenced this pull request Nov 13, 2024
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 13, 2024
LashaJini pushed a commit to LashaJini/auth that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants