changed to see Response Status
This commit is contained in:
parent
f3d305506c
commit
6b63940345
@ -114,8 +114,12 @@ getAccessToken, getTokenCredential
|
|||||||
getAccessToken oa cr = do
|
getAccessToken oa cr = do
|
||||||
let req = (fromJust $ parseUrl $ oauthAccessTokenUri oa) { method = "POST" }
|
let req = (fromJust $ parseUrl $ oauthAccessTokenUri oa) { method = "POST" }
|
||||||
rsp <- signOAuth oa cr req >>= withManager . httpLbs
|
rsp <- signOAuth oa cr req >>= withManager . httpLbs
|
||||||
let dic = parseSimpleQuery . toStrict . responseBody $ rsp
|
if statusCode rsp == 200
|
||||||
return $ Credential dic
|
then do
|
||||||
|
let dic = parseSimpleQuery . toStrict . responseBody $ rsp
|
||||||
|
return $ Credential dic
|
||||||
|
else throwIO . OAuthException $ "Gaining OAuth Temporary Credential Failed: " ++ BSL.unpack (responseBody rsp)
|
||||||
|
|
||||||
|
|
||||||
getTokenCredential = getAccessToken
|
getTokenCredential = getAccessToken
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user