webahead14 / clinic-client

0 stars 3 forks source link

Create the login page #4

Open Karyum opened 2 years ago

Karyum commented 2 years ago

For this task you will need to create the login which contains the following elements: 1) input for the government id 2) input for the password 3) submit button to send the details to the API 4) a link button to get a temporary password

inputs value/data must be saved in a react state

once the user clicks submit you need to send the data to the API at https://wa14-clinic-api.herokuapp.com/api/client/login this is a POST request and the data/object you will have to send must look like this:

// the data here is real so you can use them to test the login.
{
  govId: '2032451215',
  passcode: '123123'
}

on a successful login you will receive an access token (think of it as a movie ticket that allows you access to the cinema ), you should save that token in localStorage and then redirect the user to /home

all the code for this component need to be written in pages/Login component

Stretch task

to implement the wave effect here, look into react-wavify package

login-clinic