mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 01:16:11 +02:00
✨ Enable login flag and disable demo-users by default
This commit is contained in:
parent
36eaa18749
commit
2d76364b09
3 changed files with 8 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -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]
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue