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
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 aPOST
request and the data/object you will have to send must look like this: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
componentStretch task
to implement the wave effect here, look into
react-wavify
package