diff --git a/src/main.rs b/src/main.rs index 8285423..a8b05da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,6 +159,9 @@ fn login(form_data: Form, conn: AuthDb) -> Result 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("/"))