How to redirect within a monad in Yesod?

Posted by Squazic on Stack Overflow See other posts from Stack Overflow or by Squazic
Published on 2012-06-08T10:37:18Z Indexed on 2012/06/08 10:40 UTC
Read the original article Hit count: 266

Filed under:
|
|
|
|

I'm currently using the fb package to write a Yesod app that takes data from Facebook. In my Handler, I've managed to get the first step of the authentication to work, but I need to redirect to the url that getUserAccessTokenStep1 returns, which I've defined as fbRedirUrl. I'm having trouble with all the monad wrapping and type checking to make sure I can redirect to this url.

getAccessTokenR :: Handler RepHtml
getAccessTokenR = do
  withManager $ \manager -> do
    FB.runFacebookT creds manager $ do
      fbRedirUrl <- FB.getUserAccessTokenStep1 redirUrl []
      liftIO $ print fbRedirUrl

© Stack Overflow or respective owner

Related posts about facebook

Related posts about haskell