mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 00:26:11 +02:00
🎉 Add terms check to register
This commit is contained in:
parent
93311b8b98
commit
6c47df20af
8 changed files with 152 additions and 83 deletions
|
@ -49,8 +49,10 @@
|
|||
(declare register-profile)
|
||||
|
||||
(s/def ::invitation-token ::us/not-empty-string)
|
||||
(s/def ::terms-privacy ::us/boolean)
|
||||
|
||||
(s/def ::register-profile
|
||||
(s/keys :req-un [::email ::password ::fullname]
|
||||
(s/keys :req-un [::email ::password ::fullname ::terms-privacy]
|
||||
:opt-un [::invitation-token]))
|
||||
|
||||
(sv/defmethod ::register-profile {:auth false :rlimit :password}
|
||||
|
@ -63,6 +65,10 @@
|
|||
(ex/raise :type :validation
|
||||
:code :email-domain-is-not-allowed))
|
||||
|
||||
(when-not (:terms-privacy params)
|
||||
(ex/raise :type :validation
|
||||
:code :invalid-terms-and-privacy))
|
||||
|
||||
(db/with-atomic [conn pool]
|
||||
(let [cfg (assoc cfg :conn conn)]
|
||||
(register-profile cfg params))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue