Skip to content
Browse files

fixes #2, replaced "raw" :uri call with path-info utility

  • Loading branch information...
1 parent 54a8cb8 commit 64d91f00258fc784daf608989c57f4968b9944c4 @ddellacosta committed
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/friend_oauth2/workflow.clj
View
10 src/friend_oauth2/workflow.clj
@@ -2,6 +2,7 @@
(:require [cemerick.friend :as friend]
[clj-http.client :as client]
[ring.util.codec :as codec]
+ [ring.util.request :as ring-request]
[cheshire.core :as j]))
(defn format-config-uri
@@ -22,8 +23,6 @@
[uri-config code]
(assoc-in (uri-config :query) [:code] code))
-
-
;; http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.1
(defn extract-access-token
"Returns the access token from a JSON response body"
@@ -46,9 +45,10 @@
(fn [request]
;; If we have a callback for this workflow
;; or a login URL in the request, process it.
- (if (or (= (:uri request)
- (:path (:callback (:client-config config))))
- (= (:uri request) (config :login-uri)))
+ (if (or (= (ring-request/path-info request)
+ (-> config :client-config :callback :path))
+ (= (ring-request/path-info request)
+ (config :login-uri)))
;; Steps 2 and 3:
;; accept auth code callback, get access_token (via POST)

0 comments on commit 64d91f0

Please sign in to comment.
Something went wrong with that request. Please try again.