devscollab/skill-board-api

Login for student and superuser

Closed this issue · 0 comments

This logic goes into the app/controllers/login.js file.
test definition is already written in there, replace it with user registration logic.

logic :

  1. take the required data from req.body
  2. validate the data
  3. fetch docs with matching email.
  4. if email is present in db, then compare password. if password match ,then send success response and redirect to dashboard else send failure response with error message.
  5. else redirect to signup page
    image