...

/

Authentication

Authentication

In this lesson, we will look at authenticating our application using a JWT token generated after the user provides their credentials, followed by securing the whole app, and CRUD operations by using the token received, in the next lesson.

In this lesson, we will perform the following steps to authenticate our application.

  • Creating a login view
  • Accept user credentials required to authenticate the user
  • Send them as a POST request to the server and, if authenticated, you will receive a JWT token in the headers.
  • The above will allow the users access to the app.
  • Ensure that you send this token for making all your API requests

(The last step will be covered in the next lesson).

Let’s dive right in!

Creating a login view

On the /login route, create a simple modal to show the login view, which will look something like this:

...