mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-01-11 19:58:28 +01:00
use tls manager argument in fetchGithubProfile (introduced in 'Version upgrade (hoauth2 0.4.1)'.)
This commit is contained in:
parent
ec80c8f75e
commit
165713c350
@ -22,8 +22,7 @@ import Yesod.Auth
|
||||
import Yesod.Auth.OAuth2
|
||||
import Yesod.Core
|
||||
import Yesod.Form
|
||||
import Network.HTTP.Client (newManager)
|
||||
import Network.HTTP.Client.TLS (tlsManagerSettings)
|
||||
import Network.HTTP.Conduit(Manager)
|
||||
import Data.UUID (toString)
|
||||
import Data.UUID.V4 (nextRandom)
|
||||
import qualified Data.ByteString as BS
|
||||
@ -82,9 +81,8 @@ oauth2Github clientId clientSecret scopes = basicPlugin {apDispatch = dispatch}
|
||||
|
||||
dispatch method ps = (apDispatch basicPlugin) method ps
|
||||
|
||||
fetchGithubProfile :: AccessToken -> IO (Creds m)
|
||||
fetchGithubProfile token = do
|
||||
manager <- newManager tlsManagerSettings
|
||||
fetchGithubProfile :: Manager -> AccessToken -> IO (Creds m)
|
||||
fetchGithubProfile manager token = do
|
||||
result <- authGetJSON manager token "https://api.github.com/user"
|
||||
|
||||
case result of
|
||||
|
||||
@ -42,8 +42,6 @@ library
|
||||
, transformers >= 0.2.2 && < 0.4
|
||||
, hoauth2 >= 0.4.1 && < 0.5
|
||||
, lifted-base >= 0.2 && < 0.4
|
||||
, http-client >= 0.3 && < 0.4
|
||||
, http-client-tls >= 0.2 && < 0.3
|
||||
, uuid >= 1.3 && < 1.4
|
||||
|
||||
exposed-modules: Yesod.Auth.OAuth2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user