0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-01 09:31:26 -05:00

🐛 Use correct parameters on password update on login

This commit is contained in:
Andrey Antukh 2023-04-24 19:46:42 +02:00
parent 1f023eebeb
commit 84c8a6eced

View file

@ -63,17 +63,15 @@
:hint "login is disabled in this instance")) :hint "login is disabled in this instance"))
(letfn [(check-password [conn profile password] (letfn [(check-password [conn profile password]
(when (= (:password profile) "!") (if (= (:password profile) "!")
(ex/raise :type :validation (ex/raise :type :validation
:code :account-without-password :code :account-without-password
:hint "the current account does not have password")) :hint "the current account does not have password")
(let [result (profile/verify-password cfg password (:password profile))] (let [result (profile/verify-password cfg password (:password profile))]
(when (:update result) (when (:update result)
(l/trace :hint "updating profile password" :id (:id profile) :email (:email profile)) (l/trace :hint "updating profile password" :id (:id profile) :email (:email profile))
(profile/update-profile-password! (assoc cfg ::db/conn conn) (profile/update-profile-password! conn (assoc profile :password password)))
(assoc profile :password password))) (:valid result))))
(:valid result)))
(validate-profile [conn profile] (validate-profile [conn profile]
(when-not profile (when-not profile