December 2019
Intermediate to advanced
474 pages
10h 3m
English
The GraphQL server has already been set up to handle authentication since we sent a document containing a mutation with our login information to it. When you send the correct username and password, the server will return a JWT containing your username and expiration date. Sending a query to the GraphQL server can be done by using a Mutation component from react-apollo or by using the React Apollo Hooks, which offer you more flexibility. Logging in can be done from the Login component, which you can find in the client/src/components/Checkout/Login.js file, where the following changes need to be made to authenticate the user: