From 7de37bc9b7f4451ec4f78e0f0a9bd4c6e255a070 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Wed, 12 Jan 2022 08:46:11 +0900 Subject: [PATCH] Hide password sign-up routings when it's disabled --- src/routes/user.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/routes/user.rs b/src/routes/user.rs index ac8371a3..576fc3c6 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -18,9 +18,19 @@ use crate::utils::requires_login; use plume_common::activity_pub::{broadcast, ActivityStream, ApRequest, Id}; use plume_common::utils::md_to_html; use plume_models::{ - blogs::Blog, db_conn::DbConn, follows, headers::Headers, inbox::inbox as local_inbox, - instance::Instance, medias::Media, posts::Post, reshares::Reshare, safe_string::SafeString, - signups::Strategy as SignupStrategy, users::*, Error, PlumeRocket, CONFIG, + blogs::Blog, + db_conn::DbConn, + follows, + headers::Headers, + inbox::inbox as local_inbox, + instance::Instance, + medias::Media, + posts::Post, + reshares::Reshare, + safe_string::SafeString, + signups::{self, Strategy as SignupStrategy}, + users::*, + Error, PlumeRocket, CONFIG, }; #[get("/me")] @@ -466,6 +476,7 @@ pub fn create( form: LenientForm, conn: DbConn, rockets: PlumeRocket, + _enabled: signups::Password, ) -> Result, Ructe> { if !Instance::get_local() .map(|i| i.open_registrations)