diff --git a/backend/src/app/rpc/commands/auth.clj b/backend/src/app/rpc/commands/auth.clj index 4208051882..b5886809e8 100644 --- a/backend/src/app/rpc/commands/auth.clj +++ b/backend/src/app/rpc/commands/auth.clj @@ -63,17 +63,15 @@ :hint "login is disabled in this instance")) (letfn [(check-password [conn profile password] - (when (= (:password profile) "!") + (if (= (:password profile) "!") (ex/raise :type :validation :code :account-without-password - :hint "the current account does not have password")) - (let [result (profile/verify-password cfg password (:password profile))] - (when (:update result) - (l/trace :hint "updating profile password" :id (:id profile) :email (:email profile)) - (profile/update-profile-password! (assoc cfg ::db/conn conn) - (assoc profile :password password))) - (:valid result))) - + :hint "the current account does not have password") + (let [result (profile/verify-password cfg password (:password profile))] + (when (:update result) + (l/trace :hint "updating profile password" :id (:id profile) :email (:email profile)) + (profile/update-profile-password! conn (assoc profile :password password))) + (:valid result)))) (validate-profile [conn profile] (when-not profile