0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 22:22:43 -05:00

🐛 Fix repeated password update on login

because the default options were not being passed in the verification
This commit is contained in:
Andrey Antukh 2025-01-14 17:41:28 +01:00 committed by Alonso Torres
parent e92ddee33a
commit 5c428b5aa5

View file

@ -8,7 +8,7 @@
(:require
[buddy.hashers :as hashers]))
(def default-params
(def ^:private default-options
{:alg :argon2id
:memory 32768 ;; 32 MiB
:iterations 3
@ -16,12 +16,12 @@
(defn derive-password
[password]
(hashers/derive password default-params))
(hashers/derive password default-options))
(defn verify-password
[attempt password]
(try
(hashers/verify attempt password)
(hashers/verify attempt password default-options)
(catch Throwable _
{:update false
:valid false})))