Skip to content

Commit

Permalink
Properly detect password changes
Browse files Browse the repository at this point in the history
We were sending a password change email when just the email address was
updated, due to getting an empty string as the new password.
  • Loading branch information
tobias committed Oct 17, 2023
1 parent 1116f6c commit 07603ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clojars/web/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
(profile-form account params nil (apply concat (vals errors))))
(let [old-email (:email (find-user-by-user-or-email db account))
email-changed? (not= old-email email)
password-changed? (some? password)]
password-changed? (seq password)]
(update-user db account email account password)
(log/info {:status :success})
(when email-changed?
Expand Down

0 comments on commit 07603ad

Please sign in to comment.