netlify-labs / react-netlify-identity

a tiny (4kb) React hook for using Netlify Identity, no UI. SEEKING MAINTAINERS
https://netlify-gotrue-in-react.netlify.com/
156 stars 25 forks source link

custom claims #8

Open swyxio opened 5 years ago

swyxio commented 5 years ago

https://auth0.com/docs/scopes/current/custom-claims

jahvi commented 5 years ago

Not sure if this is part of an internal todo but it's the only thing I could find, are custom claims supported in Netlify Identity?

swyxio commented 5 years ago

they could be supported via user metadata but i was just stubbing out this issue as an idea for adding some code examples and stuff to make this work. if you'd like to mock up something i'd be open to collaborating, but before you i hadn't really prioritized it or anything. was just an idea.

jahvi commented 5 years ago

I started playing around with it and user metadata works for my use case, the only thing I found in the library is that the updateUser function doesn't expect a regular Object as documented but instead it's this format { data: { ... } }.

If you want I can submit a PR, I spent some time wondering why the user data wasn't getting updated 😄

swyxio commented 5 years ago

yeah sorry even i havent got around to using it and i work here lol

docs PR very very welcome!!!

jahvi commented 5 years ago

No worries it happens 😄

I just submitted a PR #15 let me know if you want me to change anything.