Enable login flag and disable demo-users by default

This commit is contained in:
Andrey Antukh 2022-03-10 08:37:54 +01:00
parent 36eaa18749
commit 2d76364b09
3 changed files with 8 additions and 5 deletions

View file

@ -281,10 +281,14 @@
:opt-un [::scope ::invitation-token])) :opt-un [::scope ::invitation-token]))
(sv/defmethod ::login (sv/defmethod ::login
{:auth false {:auth false ::rlimit/permits (cf/get :rlimit-password)}
::async/dispatch :default
::rlimit/permits (cf/get :rlimit-password)}
[{:keys [pool session tokens] :as cfg} {:keys [email password] :as params}] [{: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] (letfn [(check-password [profile password]
(when (= (:password profile) "!") (when (= (:password profile) "!")
(ex/raise :type :validation (ex/raise :type :validation

View file

@ -12,7 +12,7 @@
(def default (def default
"A common flags that affects both: backend and frontend." "A common flags that affects both: backend and frontend."
[:enable-registration [:enable-registration
:enable-demo-users]) :enable-login])
(defn parse (defn parse
[& flags] [& flags]

View file

@ -96,7 +96,6 @@
(login-with-ldap event (with-meta params (login-with-ldap event (with-meta params
{:on-error on-error {:on-error on-error
:on-success on-succes})))))] :on-success on-succes})))))]
[:* [:*
(when-let [message @error] (when-let [message @error]
[:& msgs/inline-banner [:& msgs/inline-banner