Repository: lldap/lldap (language: rust)

Issue:
[BUG] Password reset UI is enabled even when the feature is disabled
It seems the probe is not working. 

With the precedent of https://github.com/lldap/lldap/pull/752, we can get rid of the probe and just inject the settings in the main.js.


Discussion / hints:
I have the same problem, when I set `LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET` to `false` the UI display « Forgot your password? » link. I would like reset password is only from my OIDC Authelia ;)

It's https://github.com/lldap/lldap/pull/449 feature ;)
It's just a frontend issue, meaning that even if users click on the button, they won't be able to reset their password. But yes, it's not ideal.

Fix patch:
diff --git a/server/src/infra/auth_service.rs b/server/src/infra/auth_service.rs
index 65c1c4d8..39e0e085 100644
--- a/server/src/infra/auth_service.rs
+++ b/server/src/infra/auth_service.rs
@@ -657,5 +657,9 @@ where
             web::resource("/reset/step2/{token}")
                 .route(web::get().to(get_password_reset_step2_handler::<Backend>)),
         );
+    } else {
+        cfg.service(
+            web::resource("/reset/step1/{user_id}").route(web::post().to(HttpResponse::NotFound)),
+        );
     }
 }


Test patch: