User authetication error messages
Description
Adding error handling for user authentication.
Issue
Feature
- Added error handling for user login and user registration
Tophatting
- The endpoints now return a an error status and error message
- Message Body Format
{
"error_code": "LOGIN_SUCCESS",
"error_message": "User logged in successfully"
}
Expected current behavior
- Registration Checks:
- email, password, and username are specified
- username is unique
- username has length of 8-30 characters
- valid username format: starts with alphabet (a-z, or A-Z), all other characters can be alphabets, numbers, or underscores, length of 8-30 characters
- email verification: valid email address format by RFC 5322
- email is unique: no user with this email exists already
- password length verification: password must be at least 6 characters in length
- Login Checks:
- email is specified
- password is specified
- user with email exists
- check for password matching
Changes
- Added Error Codes
- Modified Message class to format error codes and error messages
- Added logic for authentication error handling
Screenshots
None
Design Patterns
List any design patterns used to accomplish this task None.
Deviations
Were there any deviations from the original design or architecture plan. If yes, what were they ? None.
Additional
-
Unit test written -
Meets requirements -
Cross-browser tested -
Added/updated documentation as needed -
Camel case style used
Closes #82 (closed)
Edited by Priyadarshini Saha