Add getLogoutUrl to Facebook.

This commit is contained in:
Felipe Lessa 2011-12-19 09:49:11 -02:00
parent 717d4deda5
commit 2df6650172
2 changed files with 11 additions and 1 deletions

View File

@ -10,6 +10,7 @@ module Web.Authenticate.Facebook
, getAccessToken , getAccessToken
, getGraphData , getGraphData
, getGraphData_ , getGraphData_
, getLogoutUrl
) where ) where
import Network.HTTP.Enumerator import Network.HTTP.Enumerator
@ -103,3 +104,12 @@ getGraphData_ a b = getGraphData a b >>= either (throwIO . InvalidJsonException)
data InvalidJsonException = InvalidJsonException String data InvalidJsonException = InvalidJsonException String
deriving (Show, Typeable) deriving (Show, Typeable)
instance Exception InvalidJsonException instance Exception InvalidJsonException
-- | Logs out the user from their Facebook session.
getLogoutUrl :: AccessToken
-> Text -- ^ URL the user should be directed to in your site domain.
-> Text -- ^ Logout URL in @https://www.facebook.com/@.
getLogoutUrl (AccessToken s) next =
TE.decodeUtf8 $ toByteString $
copyByteString "https://www.facebook.com/logout.php"
`mappend` renderQueryText True [("next", Just next), ("access_token", Just s)]

View File

@ -1,5 +1,5 @@
name: authenticate name: authenticate
version: 0.10.3.1 version: 0.10.4
license: BSD3 license: BSD3
license-file: LICENSE license-file: LICENSE
author: Michael Snoyman, Hiromi Ishii, Arash Rouhani author: Michael Snoyman, Hiromi Ishii, Arash Rouhani