Member-only story
Full JWT-Based Auth Implementation for Your React Apps Using a GraphQL API
A guide on how to implement an Authentication end-to-end solution for our React projects using JWT through a GraphQL API.
Update: After I published this article I got some comments telling me not to use Local Storage to store the JWT because it is a potential security risk, and they were correct. I can also go further and say that you shouldn’t be implementing your own authentication system in-house because there are a lot of caveats by doing so that you can enter into a rabbit hole. If possible you should always opt to use a service like Auth0, Okta, or something similar. Saying that, I belive this article is still useful because it is structured to be the most agnosstic possible to the authentication service that you can change it with only a few changes in the code.
In this post, we are going to see how to implement an Authentication end-to-end solution for our React projects using JWT through a GraphQL API.
The next tools, libraries, and concepts are going to be used to build the application: