]> Untitled Git - lemmy.git/blobdiff - src/api_routes_http.rs
feat: re-added captcha checks (#3249)
[lemmy.git] / src / api_routes_http.rs
index faf08938bd2458dcaff99b60e05dd8807c2740fb..375630a9243fc529c7227740e600746d3e7c2d39 100644 (file)
@@ -38,6 +38,7 @@ use lemmy_api_common::{
     ChangePassword,
     DeleteAccount,
     GetBannedPersons,
+    GetCaptcha,
     GetPersonDetails,
     GetPersonMentions,
     GetReplies,
@@ -272,6 +273,12 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) {
           .wrap(rate_limit.register())
           .route(web::post().to(route_post_crud::<Register>)),
       )
+      .service(
+        // Handle captcha separately
+        web::resource("/user/get_captcha")
+          .wrap(rate_limit.post())
+          .route(web::get().to(route_get::<GetCaptcha>)),
+      )
       // User actions
       .service(
         web::scope("/user")
@@ -335,16 +342,15 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) {
           .route(
             "/registration_application/approve",
             web::put().to(route_post::<ApproveRegistrationApplication>),
+          )
+          .service(
+            web::scope("/purge")
+              .route("/person", web::post().to(route_post::<PurgePerson>))
+              .route("/community", web::post().to(route_post::<PurgeCommunity>))
+              .route("/post", web::post().to(route_post::<PurgePost>))
+              .route("/comment", web::post().to(route_post::<PurgeComment>)),
           ),
       )
-      .service(
-        web::scope("/admin/purge")
-          .wrap(rate_limit.message())
-          .route("/person", web::post().to(route_post::<PurgePerson>))
-          .route("/community", web::post().to(route_post::<PurgeCommunity>))
-          .route("/post", web::post().to(route_post::<PurgePost>))
-          .route("/comment", web::post().to(route_post::<PurgeComment>)),
-      )
       .service(
         web::scope("/custom_emoji")
           .wrap(rate_limit.message())