December 2019
Intermediate to advanced
474 pages
10h 3m
English
The user's authentication details in the form of the JWT are now stored in the session storage, and the route to the checkout page is now private. But for the user to check out, this token should also be sent to the GraphQL server, along with every document for the server, to validate whether the user is actually authenticated or whether the token has expired. Therefore, you need to extend the setup of the Apollo Client to also send the token when you make a request to the server and prefix it with Bearer, since this is how a JWT is recognized.
Follow these steps to pass the JWT to the GraphQL server: