Improve email verify threshold

This commit is contained in:
Alejandro Alonso 2024-06-12 11:52:59 +02:00 committed by Andrey Antukh
parent 82a5754923
commit bbd9207191
2 changed files with 10 additions and 7 deletions

View file

@ -38,13 +38,11 @@
(def schema:token
[::sm/word-string {:max 6000}])
(def ^:private default-verify-threshold
(dt/duration "15m"))
(defn- elapsed-verify-threshold?
[profile]
(let [elapsed (dt/diff (:modified-at profile) (dt/now))]
(pos? (compare elapsed default-verify-threshold))))
(let [elapsed (dt/diff (:modified-at profile) (dt/now))
verify-threshold (cf/get :email-verify-threshold)]
(pos? (compare elapsed verify-threshold))))
;; ---- COMMAND: login with password