Fixes after merge

This commit is contained in:
Michael Snoyman 2013-04-24 22:00:56 +03:00
parent 98ededba28
commit d79fe24d4d
3 changed files with 5 additions and 16 deletions

View File

@ -9,4 +9,4 @@
./yesod-test ./yesod-test
./yesod-bin ./yesod-bin
./yesod ./yesod
https://github.com/yesodweb/persistent persistent1.2 https://github.com/yesodweb/persistent

View File

@ -242,7 +242,7 @@ setCreds doRedirects creds = do
-- Since 1.1.7 -- Since 1.1.7
clearCreds :: YesodAuth master clearCreds :: YesodAuth master
=> Bool -- ^ if HTTP redirect to 'logoutDest' should be done => Bool -- ^ if HTTP redirect to 'logoutDest' should be done
-> GHandler sub master () -> HandlerT master IO ()
clearCreds doRedirects = do clearCreds doRedirects = do
y <- getYesod y <- getYesod
deleteSession credsKey deleteSession credsKey
@ -282,17 +282,8 @@ getLoginR = setUltDestReferer' >> loginHandler
getLogoutR :: AuthHandler master () getLogoutR :: AuthHandler master ()
getLogoutR = setUltDestReferer' >> redirectToPost LogoutR getLogoutR = setUltDestReferer' >> redirectToPost LogoutR
<<<<<<< HEAD
postLogoutR :: YesodAuth master => GHandler Auth master ()
postLogoutR = clearCreds True
=======
postLogoutR :: AuthHandler master () postLogoutR :: AuthHandler master ()
postLogoutR = lift $ do postLogoutR = lift $ clearCreds True
y <- getYesod
deleteSession credsKey
onLogout
redirectUltDest $ logoutDest y
>>>>>>> origin/yesod1.2
handlePluginR :: Text -> [Text] -> AuthHandler master () handlePluginR :: Text -> [Text] -> AuthHandler master ()
handlePluginR plugin pieces = do handlePluginR plugin pieces = do

View File

@ -76,7 +76,6 @@ import Language.Haskell.TH.Syntax as TH
import Crypto.Conduit (hashFile, sinkHash) import Crypto.Conduit (hashFile, sinkHash)
import Crypto.Hash.MD5 (MD5) import Crypto.Hash.MD5 (MD5)
import Control.Monad.Trans.State import Control.Monad.Trans.State
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString.Base64 import qualified Data.ByteString.Base64
import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Char8 as S8
@ -100,7 +99,6 @@ import Data.Functor.Identity (runIdentity)
import qualified Filesystem.Path.CurrentOS as F import qualified Filesystem.Path.CurrentOS as F
import Filesystem.Path.CurrentOS ((</>), (<.>), FilePath) import Filesystem.Path.CurrentOS ((</>), (<.>), FilePath)
import Filesystem (createTree) import Filesystem (createTree)
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TLE import qualified Data.Text.Lazy.Encoding as TLE
import Data.Default import Data.Default
@ -341,7 +339,7 @@ mkStaticFilesList fp fs routeConName makeHash = do
mkSquashedStringsDecl squashedFinal = do mkSquashedStringsDecl squashedFinal = do
name <- newName "squashedStrings" name <- newName "squashedStrings"
pack' <- [|pack|] pack' <- [|pack|]
squashedFinal' <- lift squashedFinal squashedFinal' <- TH.lift squashedFinal
let decl = [ SigD name (ConT ''Text) let decl = [ SigD name (ConT ''Text)
, FunD name , FunD name
[ Clause [] (NormalB $ pack' `AppE` squashedFinal') [] [ Clause [] (NormalB $ pack' `AppE` squashedFinal') []
@ -350,7 +348,7 @@ mkStaticFilesList fp fs routeConName makeHash = do
return (name, decl) return (name, decl)
mkSquashedReference squashedName squashMap = \str -> mkSquashedReference squashedName squashMap = \str ->
case M.lookup str squashMap of case M.lookup str squashMap of
Nothing -> [|pack $(lift str)|] Nothing -> [|pack $(TH.lift str)|]
Just (pos, len) -> [|T.take len (T.drop pos $(return (VarE squashedName)))|] Just (pos, len) -> [|T.take len (T.drop pos $(return (VarE squashedName)))|]
mkRoute refName f = do mkRoute refName f = do
let name' = intercalate "_" $ map (map replace') f let name' = intercalate "_" $ map (map replace') f