ECellNitrr / teesco-website

Apache License 2.0
2 stars 8 forks source link

Wireup login UI to login API #22

Closed naveennvrgup closed 4 years ago

naveennvrgup commented 4 years ago

Is your feature request related to a problem? Please describe. As a user upon successful login I should be taken to homepage/landing page.

Describe the solution you'd like

  1. Wire up login API to login UI
  2. Setup protected routes
  3. User should be taken to homepage upon successful login
  4. Token received upon login should be stored in local storage.

Additional context

  1. Create a login page component (at pages/Auth/LoginPage.js) that just centers login form component on the screen. (we can do fancy stuff later).
  2. Make the login page as the first-page user see when he is logged out.
  3. If the user is logged in they should be automatically redirected into homepage when they visit the site.
  4. You can use the method suggested by @kaushik27mishra as to follow the pattern use here https://github.com/flatlogic/react-material-admin. Or you can come up with your own pattern. We can debate on the result in the PR.
naveennvrgup commented 4 years ago

Since no updates have been submitted by @kaushik27mishra I am taking over this issue.

kaushik27mishra commented 4 years ago

I am working on it, sir! I have setup the basic routes and private and public routes. I am a little confused regarding handling the different user types using React Context. So I haven't made any update yet! and I was busy for a few days in between.