diff --git a/backend/src/app/rpc/mutations/profile.clj b/backend/src/app/rpc/mutations/profile.clj index 86e5ca8f6..38a1cd182 100644 --- a/backend/src/app/rpc/mutations/profile.clj +++ b/backend/src/app/rpc/mutations/profile.clj @@ -281,10 +281,14 @@ :opt-un [::scope ::invitation-token])) (sv/defmethod ::login - {:auth false - ::async/dispatch :default - ::rlimit/permits (cf/get :rlimit-password)} + {:auth false ::rlimit/permits (cf/get :rlimit-password)} [{:keys [pool session tokens] :as cfg} {:keys [email password] :as params}] + + (when-not (contains? cf/flags :login) + (ex/raise :type :restriction + :code :login-disabled + :hint "login is disabled in this instance")) + (letfn [(check-password [profile password] (when (= (:password profile) "!") (ex/raise :type :validation diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index 149f71c65..2bdaab823 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -12,7 +12,7 @@ (def default "A common flags that affects both: backend and frontend." [:enable-registration - :enable-demo-users]) + :enable-login]) (defn parse [& flags] diff --git a/frontend/src/app/main/ui/auth/login.cljs b/frontend/src/app/main/ui/auth/login.cljs index ab371860b..39166ee59 100644 --- a/frontend/src/app/main/ui/auth/login.cljs +++ b/frontend/src/app/main/ui/auth/login.cljs @@ -96,7 +96,6 @@ (login-with-ldap event (with-meta params {:on-error on-error :on-success on-succes})))))] - [:* (when-let [message @error] [:& msgs/inline-banner