mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
✨ Add option for disable demo users.
This commit is contained in:
parent
393c9cd13c
commit
b0749b5595
@ -11,6 +11,7 @@
|
||||
"A demo specific mutations."
|
||||
(:require
|
||||
[app.common.uuid :as uuid]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.config :as cfg]
|
||||
[app.db :as db]
|
||||
[app.rpc.mutations.profile :as profile]
|
||||
@ -36,6 +37,12 @@
|
||||
:fullname fullname
|
||||
:demo? true
|
||||
: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]
|
||||
(->> (#'profile/create-profile conn params)
|
||||
(#'profile/create-profile-relations conn))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user