From 2eea63dd1a73667363ed75cb19323f9a937b2f76 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 23 Feb 2021 14:34:12 +0100 Subject: [PATCH] :sparkles: Change validation order on password recovery request mutation. --- backend/src/app/rpc/mutations/profile.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/app/rpc/mutations/profile.clj b/backend/src/app/rpc/mutations/profile.clj index 88c9611b7..b54933a42 100644 --- a/backend/src/app/rpc/mutations/profile.clj +++ b/backend/src/app/rpc/mutations/profile.clj @@ -466,16 +466,16 @@ (db/with-atomic [conn pool] (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) (ex/raise :type :validation :code :profile-is-muted :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)) (ex/raise :type :validation :code :email-has-permanent-bounces