From d244e03c79229f888552b3cac1ca6d8ce3821ef3 Mon Sep 17 00:00:00 2001 From: Chen Wenlong Date: Mon, 19 Dec 2011 22:21:52 +0800 Subject: [PATCH] add "oauth_callback" query to authorizeUrl --- Web/Authenticate/OAuth.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Web/Authenticate/OAuth.hs b/Web/Authenticate/OAuth.hs index 85b3d3bc..d48175be 100644 --- a/Web/Authenticate/OAuth.hs +++ b/Web/Authenticate/OAuth.hs @@ -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