Permalink
Browse files

Call do-openid-login properly from settings.clj

  • Loading branch information...
1 parent 0efed6a commit ddf1f35c52daf4196f3f4f01fc4728951cb228fc @chrismgray committed Dec 14, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/foreclojure/settings.clj
@@ -75,12 +75,12 @@
[:div#button-div
[:button {:type "submit"} "Submit"]]))})}))
-(defn do-update-settings! [new-username old-pwd new-pwd repeat-pwd email disable-codebox hide-solutions new-openid response-map]
+(defn do-update-settings! [new-username old-pwd new-pwd repeat-pwd email disable-codebox hide-solutions new-openid cookie-val]
(with-user [{:keys [user pwd openid]}]
(if (not= openid new-openid)
(do
(session/session-put! :login-to "/settings")
- (login/do-openid-login (assoc-in response-map [:form-params "openid-url"] new-openid)))
+ (login/do-openid-login new-openid cookie-val))
(let [encryptor (StrongPasswordEncryptor.)
new-pwd-hash (.encryptPassword encryptor new-pwd)
new-lower-user (.toLowerCase new-username)]
@@ -117,5 +117,5 @@
(defroutes settings-routes
(GET "/settings" [] (settings-page))
- (POST "/settings" {{:strs [new-username old-pwd pwd repeat-pwd email disable-codebox hide-solutions openid]} :form-params :as r}
- (do-update-settings! new-username old-pwd pwd repeat-pwd email disable-codebox hide-solutions openid r)))
+ (POST "/settings" {{:strs [new-username old-pwd pwd repeat-pwd email disable-codebox hide-solutions openid]} :form-params {:strs [ring-session]} :cookies}
+ (do-update-settings! new-username old-pwd pwd repeat-pwd email disable-codebox hide-solutions openid (:value ring-session))))

0 comments on commit ddf1f35

Please sign in to comment.