sandrinodimattia / use-auth0-hooks

An easy way to sign in with Auth0 in your React application (client-side) using React Hooks
https://nextjs-spa-auth0-demo.now.sh/
MIT License
74 stars 31 forks source link

Add token object in addition to accessToken, to expose idToken and more #15

Closed dafnarosenblum closed 4 years ago

dafnarosenblum commented 4 years ago

Before the change, the hook exposed acessToken only. But by using auth0-spa-js, we're getting also the idToken, which is needed for cases we use Auth0 as an authorisation service that defines the rules for accessing data in our server / database.

This change allows externalizing other parameters in Auth0's response, such as idToken and the expiration of the token.

corydeppen commented 4 years ago

Is there opposition to including this or anything blocking it from being merged? I think it would be a helpful addition to the library, as there doesn't appear to be a way of accessing the id token at the moment.