Hello!
I’m using the class version of the React Native Auth0 package which is documented sparingly, so I’ve been struggling a bit.
I’ve set up and an Auth0 class instance with:
const auth0 = new Auth0({
audience: config.audience,
clientId: config.clientId,
domain: config.domain,
})
and am able to authorize with:
auth0.webAuth.authorize().then(credentials => {
console.log("AUTHORIZED WITH: ", credentials)
})
That gives me what looks like a valid token – though trying to use it via CURL does not succeed, so it is possible I’m missing something already.
But what prompted me to post is this: Given the Auth0 class as created, how do you get out the logged in user’s information (givenName, familyName, email, etc)? I found this page of documentation: Auth | react-native-auth0
Which implied to me that this should work:
const userInfo = await auth0.userInfo()
as it’s a method returning a promise, however I actually see TypeError: auth0.userInfo is not a function (it is undefined).
How does one get this information out in this paradigm?
In case it’s relevant, the reason I’m doing this is because MobX and Hooks do not play well together.
Thanks!