diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 5990429..9442f1f 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -100,6 +100,7 @@ pub fn get_routes() -> Vec { Route::post("/settings/set_language", Box::new(settings_controller::set_language)), Route::post("/settings/get_security", Box::new(settings_controller::get_security)), Route::post("/settings/set_security", Box::new(settings_controller::set_security)), + Route::post("/settings/check_password", Box::new(settings_controller::check_password)), // Friends controller Route::post("/friends/getList", Box::new(friends_controller::get_list)), diff --git a/src/controllers/settings_controller.rs b/src/controllers/settings_controller.rs index 03f137e..4009b2f 100644 --- a/src/controllers/settings_controller.rs +++ b/src/controllers/settings_controller.rs @@ -116,4 +116,11 @@ pub fn set_security(r: &mut HttpRequestHandler) -> RequestResult { account_helper::set_security_settings(&new_settings)?; r.success("Security settings update.") +} + +/// Check user password +pub fn check_password(r: &mut HttpRequestHandler) -> RequestResult { + r.need_user_password("password")?; + + r.success("The password is valid.") } \ No newline at end of file