Setting up Frontend for Identity

In this lesson, we're going to set up frontend for user's identity

Setting up frontend for identity#

We can now access the endpoint for registering and logging in the user. We also saw that the tokens are being generated from our server and we can also use them to authorize the user; we just have to work on the frontend. Let's go to the agent.ts file and now, we will create a new object for the Users endpoint; let's call it Users, and we have two endpoints; one is for login and the other for register.

Let's start with login. It will take values which will have email and password. Let's go inside the models folder and create a new file called user.ts. Let's export interface login which will have email of type string and password of type string; and second interface for Register which will have username of type string. The rest will stay the same.

client/src/models/user.ts

 

Loading...

Start a new discussion. All notification go to the author.

Loading...