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