mirror of
https://github.com/penpot/penpot.git
synced 2025-02-08 16:18:11 -05:00
✨ Add option for disable demo users.
This commit is contained in:
parent
393c9cd13c
commit
b0749b5595
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
"A demo specific mutations."
|
"A demo specific mutations."
|
||||||
(:require
|
(:require
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
|
[app.common.exceptions :as ex]
|
||||||
[app.config :as cfg]
|
[app.config :as cfg]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.rpc.mutations.profile :as profile]
|
[app.rpc.mutations.profile :as profile]
|
||||||
|
@ -36,6 +37,12 @@
|
||||||
:fullname fullname
|
:fullname fullname
|
||||||
:demo? true
|
:demo? true
|
||||||
:password password}]
|
:password password}]
|
||||||
|
|
||||||
|
(when-not (:allow-demo-users cfg/config)
|
||||||
|
(ex/raise :type :validation
|
||||||
|
:code :demo-users-not-allowed
|
||||||
|
:hint "Demo users are disabled by config."))
|
||||||
|
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(->> (#'profile/create-profile conn params)
|
(->> (#'profile/create-profile conn params)
|
||||||
(#'profile/create-profile-relations conn))
|
(#'profile/create-profile-relations conn))
|
||||||
|
|
Loading…
Add table
Reference in a new issue