From aa5327d6037600496d598bbb4fb96761fb2a3b71 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sun, 3 Apr 2022 17:48:55 +0200 Subject: [PATCH] Improve returned error code --- src/controllers/login_controller.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/login_controller.rs b/src/controllers/login_controller.rs index 3c28ec1..71bf22e 100644 --- a/src/controllers/login_controller.rs +++ b/src/controllers/login_controller.rs @@ -75,7 +75,7 @@ pub async fn login_route( .await.unwrap(); if failed_attempts > MAX_FAILED_LOGIN_ATTEMPTS { - return HttpResponse::InternalServerError().body( + return HttpResponse::TooManyRequests().body( FatalErrorPage { message: "Too many failed login attempts, please try again later!" }.render().unwrap()