diff options
author | Joey Hess <joey@kitenet.net> | 2013-06-03 16:33:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-06-03 18:14:22 -0400 |
commit | 69a819844c4f062e4ed21d183bbce091c39ee7f8 (patch) | |
tree | c5a78d8af3d5dff45b1db3bb3c3f49efb57174ea /Utility/WebApp.hs | |
parent | c4e38c013f61d9b3482eb5592619e619d67b9146 (diff) |
now builds with both yesod 1.2 and 1.1
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r-- | Utility/WebApp.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 240d097b0..f3c0d3a6b 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -178,7 +178,11 @@ lookupRequestField k req = fromMaybe "" . lookup k $ Wai.requestHeaders req {- Rather than storing a session key on disk, use a random key - that will only be valid for this run of the webapp. -} +#if MIN_VERSION_yesod(1,2,0) webAppSessionBackend :: Yesod.Yesod y => y -> IO (Maybe Yesod.SessionBackend) +#else +webAppSessionBackend :: Yesod.Yesod y => y -> IO (Maybe (Yesod.SessionBackend y)) +#endif webAppSessionBackend _ = do g <- newGenIO :: IO SystemRandom case genBytes 96 g of @@ -218,7 +222,11 @@ genRandomToken = do - Note that the usual Yesod error page is bypassed on error, to avoid - possibly leaking the auth token in urls on that page! -} +#if MIN_VERSION_yesod(1,2,0) checkAuthToken :: (Monad m, Yesod.MonadHandler m) => (Yesod.HandlerSite m -> T.Text) -> m Yesod.AuthResult +#else +checkAuthToken :: forall t sub. (t -> T.Text) -> Yesod.GHandler sub t Yesod.AuthResult +#endif checkAuthToken extractToken = do webapp <- Yesod.getYesod req <- Yesod.getRequest |