Skip to content

Add test cases for Authorization #55

@DavianYang

Description

@DavianYang

Auth routes

/api/v1/users/register

  • POST: / should register user if required given data is provided
  • POST: / should return 400 error if given email is invalid
  • POST: / should return 400 error if given email is already used
  • POST: / should return 400 error if password length is less than 8 characters
  • POST: / should return 400 error if given password doesn’t contain both letters and characters

/api/v1/users/login

  • POST: / should login user if email and password match
  • POST: / should return 401 error if there is no user with given email
  • POST: / should return 401 error if given password is incorrect

/api/v1/users/logout

  • POST: / should return 204 status if refresh token is valid

/api/v1/users/forgotPassword

  • POST: / should return 204 and send reset token email to user
  • POST: / should send 400 if user didn't provide email
  • POST: / should send 404 if email doesn't belong to any of users

/api/v1/users/resetPassword

  • POST: / should return 204 and reset the password
  • POST: / should return 401 if reset token is missing
  • POST: / should return 400 if token is expired or user is not found

/api/v1/users/updateMyPassword

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions