diff --git a/Web/Authenticate/Facebook.hs b/Web/Authenticate/Facebook.hs index 09b0520a..0769049f 100644 --- a/Web/Authenticate/Facebook.hs +++ b/Web/Authenticate/Facebook.hs @@ -60,6 +60,7 @@ accessTokenUrl fb code = [ ("client_id", Just $ facebookClientId fb) , ("redirect_uri", Just $ facebookRedirectUri fb) , ("code", Just code) + , ("client_secret", Just $ facebookClientSecret fb) ] getAccessToken :: Facebook -> Text -> IO AccessToken diff --git a/authenticate.cabal b/authenticate.cabal index 68f0ab89..3a753a3e 100644 --- a/authenticate.cabal +++ b/authenticate.cabal @@ -16,7 +16,7 @@ homepage: http://github.com/snoyberg/authenticate/tree/master library build-depends: base >= 4 && < 5, aeson >= 0.3.1.1 && < 0.4, - http-enumerator >= 0.6 && < 0.7, + http-enumerator >= 0.6.5.2 && < 0.7, tagsoup >= 0.6 && < 0.13, failure >= 0.0.0 && < 0.2, transformers >= 0.1 && < 0.3, diff --git a/facebook.hs b/facebook.hs index e86e5936..1495a86a 100644 --- a/facebook.hs +++ b/facebook.hs @@ -22,23 +22,24 @@ instance Yesod FB where approot _ = "http://localhost:3000" getRootR = do FB f <- getYesod - let s = encodeUtf8 $ getForwardUrl f ["email"] + let s = getForwardUrl f ["email"] + liftIO $ print ("Redirecting", s) redirectString RedirectTemporary s return () getFacebookR = do FB f <- getYesod code <- runFormGet' $ stringInput "code" - at <- liftIO $ getAccessToken f $ pack code + at <- liftIO $ getAccessToken f code mreq <- runFormGet' $ maybeStringInput "req" let req = fromMaybe "me" mreq - Right so <- liftIO $ getGraphData at $ pack req + Right so <- liftIO $ getGraphData at req let so' = objToHamlet so hamletToRepHtml [$hamlet|\