From 0e80564f85a53a16b84f9f9a1a9c5fa00446e047 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 23 Jan 2021 09:56:19 +0100 Subject: [PATCH] Remove resolved TODOs --- src/controllers/account_controller.rs | 6 ------ src/controllers/routes.rs | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/controllers/account_controller.rs b/src/controllers/account_controller.rs index 4492320..b60e162 100644 --- a/src/controllers/account_controller.rs +++ b/src/controllers/account_controller.rs @@ -44,7 +44,6 @@ impl HttpRequestHandler { /// Create a new account pub fn create(r: &mut HttpRequestHandler) -> RequestResult { - // TODO : limit request // Get & check email let email = r.post_email("emailAddress")?; @@ -61,8 +60,6 @@ pub fn create(r: &mut HttpRequestHandler) -> RequestResult { account_helper::create(&new_account)?; - // TODO : limit request - r.success("Account created!") } @@ -71,8 +68,6 @@ pub fn login_user(request: &mut HttpRequestHandler) -> RequestResult { let email = request.post_email("userMail")?; let password = request.post_string_opt("userPassword", 3, true)?; - // TODO : limit request - // Authenticate user let token = account_helper::login_user( &email, &password, request.api_client()); @@ -82,7 +77,6 @@ pub fn login_user(request: &mut HttpRequestHandler) -> RequestResult { request.set_response(LoginSuccess::new(&t)) } Err(e) => { - // TODO : limit request println!("Error on login: {}", e); request.forbidden("Invalid email address / password!".to_string()) } diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index bf7e5c0..9e617fb 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -232,7 +232,7 @@ pub fn get_routes() -> Vec { Route::post("/groups/get_membership", Box::new(groups_controller::get_membership)), Route::post("/groups/remove_membership", Box::new(groups_controller::remove_membership)), Route::post("/groups/set_following", Box::new(groups_controller::set_following)), - Route::post("/groups/delete", Box::new(groups_controller::delete_group)), + Route::limited_post("/groups/delete", Box::new(groups_controller::delete_group), LimitPolicy::FAILURE(10)), // Posts controller