Fail suspended logins
This commit is contained in:
parent
7f59729f1f
commit
6548aa0b7e
|
@ -159,6 +159,9 @@ fn login(form_data: Form<LoginData>, conn: AuthDb) -> Result<Redirect, Flash<Red
|
|||
Ok(user) => user,
|
||||
_ => return Err(Flash::error(Redirect::to(uri!(login_form)), "Failed to fetch user")),
|
||||
};
|
||||
if ! user.is_active {
|
||||
return Err(Flash::error(Redirect::to(uri!(login_form)), "Account is suspended"));
|
||||
}
|
||||
println!("User: {:?}", user);
|
||||
|
||||
Ok(Redirect::to("/"))
|
||||
|
|
Loading…
Reference in New Issue