Permalink
Browse files

extendUserAccessToken should return a valid user ID on the token.

  • Loading branch information...
1 parent beff59e commit ebb27870fb75d15b9bfe4b20f13dd0f53da5c751 @meteficha meteficha committed Jun 14, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −1 fb.cabal
  2. +4 −2 src/Facebook/Auth.hs
View
2 fb.cabal
@@ -1,5 +1,5 @@
name: fb
-version: 0.9.6
+version: 0.9.7
license: BSD3
license-file: LICENSE
author: Felipe Lessa
View
6 src/Facebook/Auth.hs
@@ -266,7 +266,7 @@ isValid token = do
extendUserAccessToken :: (MonadBaseControl IO m, C.MonadResource m) =>
UserAccessToken
-> FacebookT Auth m (Either FacebookException UserAccessToken)
-extendUserAccessToken token@(UserAccessToken _ data_ _)
+extendUserAccessToken token@(UserAccessToken uid data_ _)
= do expired <- hasExpired token
if expired then return (Left hasExpiredExc) else tryToExtend
where
@@ -279,7 +279,9 @@ extendUserAccessToken token@(UserAccessToken _ data_ _)
case eresponse of
Right response -> do
now <- liftIO getCurrentTime
- return (Right $ userAccessTokenParser now response)
+ return (Right $ case userAccessTokenParser now response of
+ UserAccessToken _ data' expires' ->
+ UserAccessToken uid data' expires')
Left exc -> return (Left exc)
hasExpiredExc =

0 comments on commit ebb2787

Please sign in to comment.