add "oauth_callback" query to authorizeUrl

This commit is contained in:
Chen Wenlong 2011-12-19 22:21:52 +08:00
parent 717d4deda5
commit d244e03c79

View File

@ -128,7 +128,10 @@ getTemporaryCredential' hook oa = do
authorizeUrl :: OAuth -- ^ OAuth Application
-> Credential -- ^ Temporary Credential (Request Token & Secret)
-> String -- ^ URL to authorize
authorizeUrl oa cr = oauthAuthorizeUri oa ++ BS.unpack (renderSimpleQuery True [("oauth_token", token cr)])
authorizeUrl oa cr = oauthAuthorizeUri oa ++ BS.unpack (renderSimpleQuery True queries)
where queries = case oauthCallback oa of
Nothing -> [("oauth_token", token cr)]
Just callback -> [("oauth_token", token cr), ("oauth_callback", callback)]
-- | Get Access token.
getAccessToken, getTokenCredential