From bdefe0d04e209087d72586e060028e884216eee2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 15 Sep 2020 15:34:49 +0200 Subject: [PATCH] :arrow_up: Adapt some changes to latest version of buddy-hashers. --- backend/deps.edn | 2 +- backend/src/app/services/mutations/profile.clj | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/deps.edn b/backend/deps.edn index 2abd02f29..79575ad0d 100644 --- a/backend/deps.edn +++ b/backend/deps.edn @@ -39,7 +39,7 @@ buddy/buddy-core {:mvn/version "1.8.0"} - buddy/buddy-hashers {:mvn/version "1.5.1"} + buddy/buddy-hashers {:mvn/version "1.6.0"} lambdaisland/uri {:mvn/version "1.4.54" :exclusions [org.clojure/data.json]} diff --git a/backend/src/app/services/mutations/profile.clj b/backend/src/app/services/mutations/profile.clj index 480410a02..117cbf40d 100644 --- a/backend/src/app/services/mutations/profile.clj +++ b/backend/src/app/services/mutations/profile.clj @@ -113,7 +113,7 @@ (defn- verify-password [attempt password] - (hashers/check attempt password)) + (hashers/verify attempt password)) (defn- create-profile "Create the profile entry on the database with limited input @@ -166,7 +166,7 @@ (when (= (:password profile) "!") (ex/raise :type :validation :code ::account-without-password)) - (verify-password password (:password profile))) + (:valid (verify-password password (:password profile)))) (validate-profile [profile] (when-not profile @@ -249,7 +249,7 @@ (defn- validate-password! [conn {:keys [profile-id old-password] :as params}] (let [profile (profile/retrieve-profile-data conn profile-id)] - (when-not (verify-password old-password (:password profile)) + (when-not (:valid (verify-password old-password (:password profile))) (ex/raise :type :validation :code ::old-password-not-match))))