sign in with email

This commit is contained in:
realaravinth
2021-06-29 19:42:07 +05:30
parent c581d8d0a3
commit d5aceb60b4
7 changed files with 68 additions and 27 deletions

View File

@@ -50,6 +50,8 @@ pub enum ServiceError {
WrongPassword,
#[display(fmt = "Username not found")]
UsernameNotFound,
#[display(fmt = "Account not found")]
AccountNotFound,
/// when the value passed contains profainity
#[display(fmt = "Can't allow profanity in usernames")]
@@ -114,6 +116,7 @@ impl ResponseError for ServiceError {
ServiceError::NotAUrl => StatusCode::BAD_REQUEST,
ServiceError::WrongPassword => StatusCode::UNAUTHORIZED,
ServiceError::UsernameNotFound => StatusCode::NOT_FOUND,
ServiceError::AccountNotFound => StatusCode::NOT_FOUND,
ServiceError::ProfainityError => StatusCode::BAD_REQUEST,
ServiceError::BlacklistError => StatusCode::BAD_REQUEST,