mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-30 07:21:01 +00:00
Fake password verification when trying to login with inexistant account
Fix #170
This commit is contained in:
parent
78b3202a32
commit
3373bb66cd
1 changed files with 4 additions and 0 deletions
|
@ -57,6 +57,10 @@ fn create(conn: DbConn, data: LenientForm<LoginForm>, flash: Option<FlashMessage
|
|||
Err(e) => e
|
||||
};
|
||||
if let Err(_) = user.clone() {
|
||||
// Fake password verification, only to avoid different login times
|
||||
// that could be used to see if an email adress is registered or not
|
||||
User::get(&*conn, 1).map(|u| u.auth(form.password.clone()));
|
||||
|
||||
let mut err = ValidationError::new("invalid_login");
|
||||
err.message = Some(Cow::from("Invalid username or password"));
|
||||
errors.add("email_or_name", err)
|
||||
|
|
Loading…
Reference in a new issue