Skip to content

Commit

Permalink
Updating login.rs with generic incorrect_login response. (LemmyNe…
Browse files Browse the repository at this point in the history
  • Loading branch information
rosenjcb authored and PawanHegde committed Jul 10, 2023
1 parent d6147d1 commit 9167d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/api/src/local_user/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Perform for Login {
let username_or_email = data.username_or_email.clone();
let local_user_view = LocalUserView::find_by_email_or_name(context.pool(), &username_or_email)
.await
.map_err(|e| LemmyError::from_error_message(e, "couldnt_find_that_username_or_email"))?;
.map_err(|e| LemmyError::from_error_message(e, "incorrect_login"))?;

// Verify the password
let valid: bool = verify(
Expand All @@ -32,7 +32,7 @@ impl Perform for Login {
)
.unwrap_or(false);
if !valid {
return Err(LemmyError::from_message("password_incorrect"));
return Err(LemmyError::from_message("incorrect_login"));
}
check_user_valid(
local_user_view.person.banned,
Expand Down

0 comments on commit 9167d7f

Please sign in to comment.