Skip to content

Commit

Permalink
Merge pull request #36 from Commonfare-net/feature/reset-password-fix
Browse files Browse the repository at this point in the history
Feature/reset password fix
  • Loading branch information
aspasia committed Nov 21, 2019
2 parents 7b14ec8 + a9905c6 commit c6a8a62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject org.clojars.dyne/just-auth "0.5.1"
(defproject org.clojars.dyne/just-auth "0.6.0"
:description "Simple two factor authentication library"
:url "https://github.com/PIENews/just-auth"

Expand Down
9 changes: 3 additions & 6 deletions src/just_auth/core.clj
Expand Up @@ -62,7 +62,7 @@

(de-activate-account [this email password])

(reset-password [this email old-password new-password second-step-conf])
(reset-password [this email new-password second-step-conf])

(list-accounts [this params]))

Expand Down Expand Up @@ -184,12 +184,9 @@
;; TODO
)

(reset-password [_ email old-password new-password {:keys [password-reset-link]}]
(reset-password [_ email new-password {:keys [password-reset-link]}]
(if (= (pr/fetch-by-password-recovery-link password-recovery-store password-reset-link))
(if (account/correct-password? account-store email old-password (:hash-check-fn hash-fns))
(account/update-password! account-store email new-password (:hash-fn hash-fns))
;; TODO: send email?
(f/fail (t/locale [:error :core :wrong-pass])))
(account/update-password! account-store email new-password (:hash-fn hash-fns))
(f/fail (t/locale [:error :core :expired-link]))))

(list-accounts [_ params]
Expand Down

0 comments on commit c6a8a62

Please sign in to comment.