-
Notifications
You must be signed in to change notification settings - Fork 313
Description
Hello,
I wanted to give the fullstack react example a try.
I followed the steps in How To GraphQL and got to the point where in the Playground I was trying to query the server running at port :4000.
I followed the instructions of generating a token using prisma token
and added the token to the authentication header.
When I tried to run a query I was getting an "Invalid Signature".
After a while of looking at the server/src/util.js file that seems to authenticate the requests, I noticed it is using the APP_SECRET to verify the token
const { userId } = jwt.verify(token, process.env.APP_SECRET)
What I suspected is that prisma token
command would use the PRISMA_SECRET and not the APP_SECRET, when I changed that to use the PRISMA_SECRET, the server started responding with data.
If the above an issue in the boilerplate example or am I doing something wrong?
I read a couple blog posts about the difference between the 2 secrets and I think I get that the PRISMA_SECRET will never make it into the client and it will remain truely a secret, but I am not sure what the APP_SECRET is used for and why it is being used in the server/src/util.js logic?
I just feel I may be doing something wrong and would appreciate some help.
Thanks