From 6548aa0b7e2952d93f3d9c43b1ae90a2631d8be4 Mon Sep 17 00:00:00 2001 From: Alex Wright Date: Sun, 1 Mar 2020 21:31:38 +0100 Subject: [PATCH] Fail suspended logins --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) 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("/"))