Summary
In this chapter, we learned how JWTs work in depth. First, we learned about the theory of authentication and JWTs, and how to manually create them. Then, we implemented login, signup, and authenticated routes in the backend. Next, we integrated these routes in the frontend by creating new pages and routing between them using React Router. Finally, we wrapped up this chapter by learning about advanced token handling and giving pointers on more things to learn about authentication and role management.
In the next chapter, Chapter 7, Improving the Load Time Using Server-Side Rendering, we are going to learn how to implement server-side rendering to improve the initial load time of our blog. We are already doing a lot of requests on the first load (fetching all blog posts, then the usernames of each author). We can bundle them together by doing this on the backend.