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
Describe the ideal solution
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
Alternatives and current work-arounds
Note I can think of several ways to do this. Eg. have a getToken function which
Gets the token from localStorage
Or calls an api endpoint which would give a response using the auth0.getSession method
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.
The text was updated successfully, but these errors were encountered:
@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.