Permalink
Browse files

retrieve password same way as username

Update interactive-form workflow to check form-params for "password" key, as is done for username.

There is certainly a prettier way to handle both of these, but this should suffice.
  • Loading branch information...
1 parent 5ed6b54 commit 6075c532463434db78353f82e0d7559849db062a @kierendavies kierendavies committed Feb 27, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/cemerick/friend/workflows.clj
@@ -61,6 +61,10 @@
[form-params params]
(or (get form-params "username") (:username params "")))
+(defn- password
+ [form-params params]
+ (or (get form-params "password") (:password params "")))
+
(defn interactive-login-redirect
[{:keys [form-params params] :as request}]
(ring.util.response/redirect
@@ -79,7 +83,7 @@
(when (and (= (gets :login-uri form-config (::friend/auth-config request)) (req/path-info request))
(= :post request-method))
(let [creds {:username (username form-params params)
- :password (:password params)}
+ :password (password form-params params)}
{:keys [username password]} creds]
(if-let [user-record (and username password
((gets :credential-fn form-config (::friend/auth-config request))

0 comments on commit 6075c53

Please sign in to comment.