In the preceding chapter, we discussed how to interface with an API to do the following through a backend server:
- Fetch posts
- Fetch users
- Create user accounts (registration)
- Create posts
We got one step closer to a fully functional blog application. However, there is still an essential feature missing: login and authentication of users.
After creating a user account, there should be a way to login. Only after being logged in should the user be able to access the New post form. In this chapter, we will remove the username field from the form and instead use authentication to automatically use the currently loggedin user.
In this chapter, we will cover the following topics:
- Learning what JSON Web Tokens (JWT) are and how they can be used
- Implementing token authentication via JWT in our application