I am having difficulty figuring out how to use this library with Apollo Client.
Detail: I have a nextjs app with accesses an external api (hasura) which require JWT authentication. I would love a best practice example (that ideally does not use local storage) for passing a JWT token (specifically hasura uses the idToken) in the request header from apollo client
The ideal solution would be an example showing a best practice way to pass the token from an API route to the front end without using express and then showing what the apollo client looks like
Note I can think of several ways to do this. Eg. have a getToken function which
What I am looking for is best preactice/secure as possible.
Sorry I am relatively newbie.
Add any other context or screenshots about the feature request here.
@shansmith01 Have you figured out what should be the best practice? So I think the issue title could be even changed since basically we need just an example of how to properly use access token from the client side, or any clarifications about why everything should be hidden behind nextjs api routes.
@lnikell have you found a solution by any chance? without using the proxy?
@serendipity1004 I decided to move to https://github.com/iaincollins/next-auth and stop trying to get anything from Auth0 or their support.
Hi all, please check out the Access an external API from an API route example from the new v1.0.0-beta.0 release. The issues https://github.com/auth0/nextjs-auth0/issues/67 https://github.com/auth0/nextjs-auth0/issues/55 might also be useful for Apollo Client users.
any clarifications about why everything should be hidden behind nextjs api routes.
We have included information about this in the README of the new beta.