Permalink
Browse files

Fixed clack.middleware.oauth.

  • Loading branch information...
Tomohiro Matsuyama
Tomohiro Matsuyama committed May 10, 2011
1 parent e341d9c commit c05c0524d163a57d1f109c89c2f9b9fee3bf052c
Showing with 10 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +8 −6 src/contrib/middleware/oauth.lisp
View
@@ -1,4 +1,6 @@
*.fasl
*.dx32fsl
*.dx64fsl
+*.lx32fsl
+*.lx64fsl
*.x86f
@@ -41,7 +41,9 @@
(cl-oauth:make-consumer-token
:key (oauth-consumer-key this)
:secret (oauth-consumer-secret this))
- :callback-uri (format nil "~a~a" (oauth-callback-base this) (oauth-path this))))
+ :callback-uri (concatenate 'string
+ (oauth-callback-base this)
+ (oauth-path this))))
(state (oauth-state this)))
(when (gethash (cl-oauth:token-key req-token) state)
(error "OAuth request token collision is detected."))
@@ -50,7 +52,7 @@
req-token))
(defmethod obtain-request-token ((this <clack-middleware-oauth>) req)
- (bind ((oauth-token (query-parameters req "oauth_token"))
+ (bind ((oauth-token (query-parameter req "oauth_token"))
((req-token time) (gethash oauth-token (oauth-state this))))
@ignore time
req-token))
@@ -73,8 +75,8 @@
(< (- now (second it)) (oauth-state-expire this))))))
(defmethod is-authorizing ((this <clack-middleware-oauth>) req)
- (let ((oauth-token (query-parameters req "oauth_token"))
- (oauth-verifier (query-parameters req "oauth_verifier")))
+ (let ((oauth-token (query-parameter req "oauth_token"))
+ (oauth-verifier (query-parameter req "oauth_verifier")))
(and oauth-token oauth-verifier
(not (is-expired this oauth-token)))))
@@ -91,8 +93,8 @@
(finalize res)))
(defmethod authorize-cont ((this <clack-middleware-oauth>) req)
- (let ((oauth-token (query-parameters req "oauth_token"))
- (oauth-verifier (query-parameters req "oauth_verifier"))
+ (let ((oauth-token (query-parameter req "oauth_token"))
+ (oauth-verifier (query-parameter req "oauth_verifier"))
(req-token (obtain-request-token this req)))
(setf (cl-oauth:request-token-verification-code req-token) oauth-verifier)
(cl-oauth:authorize-request-token req-token)

0 comments on commit c05c052

Please sign in to comment.