blibli-future / detroit

Project Detroit
5 stars 0 forks source link

Feature/frontend/login system #49

Closed adhikasp closed 7 years ago

adhikasp commented 7 years ago

Create login system for frontend:

How login works:

  1. Users fill email & password form in login page.
  2. The credential then will sent to /api/v1/users/check to make sure the credential is correct. If incorrect, server will throw 403 and the login page will shown a "incorrect email/password" error.
  3. Correct credential will be saved into localStorage (like a browser's cookie, but can be accessed via JS).
  4. Every API call from frontend will use credential taken from localStorage. If it doesn't exist or invalid, then users will be redirected to login page again.

Important note