Replies: 3 comments 1 reply
-
Hi there! Thank you for the praise! ♥ I think the usual (or at least the most common) way of authorizing a request is to add an The JWT token we generate is probably not something you want to send, since it is only meant to be used in that single application. You can hovewer use it to store your access token with the help of the Now it depends on how you wish to communicate from your application with GraphQL, but one way is to create a simple fetch wrapper functioning as your GraphQL client (or use something like |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I thought I might've asked the question in a confusing way and with too much context. I meant quite simple proposal — maybe makes more sense to encrypt https://github.com/nextauthjs/next-auth/blob/canary/src/lib/jwt.js#L47 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to say first, that this is the best library I saw for doing authorization for next.js!
I am building a SPA, which is going to fetch its data from a GraphQL backend. In order to secure the calls to my backend service, I was thinking of sending a raw JWT token and validating it there, using the same keys.
I managed to do it, but stumbled upon behavior that surprised me:
My backend authorization library expects it to be either one or another.
Of course, I can work around it, but I was wondering, what is the reasoning behind this behavior?
If I can decrypt a token, why do we need to sign it?
Would you be open to a PR, which would change that?
Beta Was this translation helpful? Give feedback.
All reactions