use tls manager argument in fetchGithubProfile (introduced in 'Version upgrade (hoauth2 0.4.1)'.)

This commit is contained in:
Freiric Barral 2014-08-29 18:54:04 +02:00
parent ec80c8f75e
commit 165713c350
2 changed files with 3 additions and 7 deletions

View File

@ -22,8 +22,7 @@ import Yesod.Auth
import Yesod.Auth.OAuth2 import Yesod.Auth.OAuth2
import Yesod.Core import Yesod.Core
import Yesod.Form import Yesod.Form
import Network.HTTP.Client (newManager) import Network.HTTP.Conduit(Manager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Data.UUID (toString) import Data.UUID (toString)
import Data.UUID.V4 (nextRandom) import Data.UUID.V4 (nextRandom)
import qualified Data.ByteString as BS import qualified Data.ByteString as BS
@ -82,9 +81,8 @@ oauth2Github clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
dispatch method ps = (apDispatch basicPlugin) method ps dispatch method ps = (apDispatch basicPlugin) method ps
fetchGithubProfile :: AccessToken -> IO (Creds m) fetchGithubProfile :: Manager -> AccessToken -> IO (Creds m)
fetchGithubProfile token = do fetchGithubProfile manager token = do
manager <- newManager tlsManagerSettings
result <- authGetJSON manager token "https://api.github.com/user" result <- authGetJSON manager token "https://api.github.com/user"
case result of case result of

View File

@ -42,8 +42,6 @@ library
, transformers >= 0.2.2 && < 0.4 , transformers >= 0.2.2 && < 0.4
, hoauth2 >= 0.4.1 && < 0.5 , hoauth2 >= 0.4.1 && < 0.5
, lifted-base >= 0.2 && < 0.4 , lifted-base >= 0.2 && < 0.4
, http-client >= 0.3 && < 0.4
, http-client-tls >= 0.2 && < 0.3
, uuid >= 1.3 && < 1.4 , uuid >= 1.3 && < 1.4
exposed-modules: Yesod.Auth.OAuth2 exposed-modules: Yesod.Auth.OAuth2