mirror of
https://github.com/penpot/penpot.git
synced 2025-05-15 06:16:38 +02:00
✨ Change validation order on password recovery request mutation.
This commit is contained in:
parent
7e1ee087d3
commit
2eea63dd1a
1 changed files with 5 additions and 5 deletions
|
@ -466,16 +466,16 @@
|
||||||
|
|
||||||
(db/with-atomic [conn pool]
|
(db/with-atomic [conn pool]
|
||||||
(when-let [profile (profile/retrieve-profile-data-by-email conn email)]
|
(when-let [profile (profile/retrieve-profile-data-by-email conn email)]
|
||||||
(when-not (:is-active profile)
|
|
||||||
(ex/raise :type :validation
|
|
||||||
:code :profile-not-verified
|
|
||||||
:hint "the user need to validate profile before recover password"))
|
|
||||||
|
|
||||||
(when-not (emails/allow-send-emails? conn profile)
|
(when-not (emails/allow-send-emails? conn profile)
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :validation
|
||||||
:code :profile-is-muted
|
:code :profile-is-muted
|
||||||
:hint "looks like the profile has reported repeatedly as spam or has permanent bounces."))
|
:hint "looks like the profile has reported repeatedly as spam or has permanent bounces."))
|
||||||
|
|
||||||
|
(when-not (:is-active profile)
|
||||||
|
(ex/raise :type :validation
|
||||||
|
:code :profile-not-verified
|
||||||
|
:hint "the user need to validate profile before recover password"))
|
||||||
|
|
||||||
(when (emails/has-bounce-reports? conn (:email profile))
|
(when (emails/has-bounce-reports? conn (:email profile))
|
||||||
(ex/raise :type :validation
|
(ex/raise :type :validation
|
||||||
:code :email-has-permanent-bounces
|
:code :email-has-permanent-bounces
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue