mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 22:16:37 +02:00
✨ Add parameter to disable registration
This commit is contained in:
parent
79f7d29df9
commit
e8bd7436aa
6 changed files with 14 additions and 2 deletions
|
@ -56,6 +56,8 @@
|
|||
:smtp-ssl (lookup-env env :uxbox-smtp-ssl false)
|
||||
:smtp-enabled (lookup-env env :uxbox-smtp-enabled false)
|
||||
|
||||
:registration-enabled (lookup-env env :uxbox-registration-enabled true)
|
||||
|
||||
:secret (lookup-env env :uxbox-secret "5qjiAndGY3")})
|
||||
|
||||
(defn read-test-config
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
[buddy.sign.jwe :as jwe]
|
||||
[uxbox.sql :as sql]
|
||||
[uxbox.db :as db]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.util.spec :as us]
|
||||
[uxbox.emails :as emails]
|
||||
[uxbox.services.core :as core]
|
||||
|
@ -186,8 +187,11 @@
|
|||
(defmethod core/novelty :register-profile
|
||||
[params]
|
||||
(s/assert ::register params)
|
||||
(with-open [conn (db/connection)]
|
||||
(sc/apply-atomic conn register-user params)))
|
||||
(if (= (:registration-enabled config) true)
|
||||
(with-open [conn (db/connection)]
|
||||
(sc/apply-atomic conn register-user params))
|
||||
(ex/raise :type :validation
|
||||
:code ::registration-disabled)))
|
||||
|
||||
;; --- Password Recover
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue