Login API Documentation - bounswe/bounswe2022group5 GitHub Wiki

Login

Log user in with credentials that are needed for a user to login.

URL : /auth/login/

Method : POST

Auth required : NO

Permissions required : None

Success Response

Code : 200 OK

Body

User Types:

{
    "ADMIN": 0
    "DOCTOR": 1,
    "MEMBER": 2,
}

For User:

{
    "email": [email protected],
    "password": joedoepassword,
    "type": 2,
}

For Token:

{
    "data": {
             "email":[email protected],
             "password: joedowpassword
             }
    "token": 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
}

Notes

  • Initially, the default signup endpoint handles the fields of the Abstract Base User class.
  • If the user is a Doctor (type: 1), they can only use their e-mail address to login.
  • If the user is a Member (type: 2), they can either use their e-mail address or their username to login. It is checked later which is used.