diff --git a/.gitmodules b/.gitmodules index 1afb9379..06461f96 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/snoyberg/xml [submodule "crypto-conduit"] path = crypto-conduit - url = https://github.com/snoyberg/crypto-conduit + url = https://github.com/snoyberg/crypto-conduit.git [submodule "yaml"] path = yaml url = https://github.com/snoyberg/yaml diff --git a/authenticate b/authenticate new file mode 160000 index 00000000..c61c883b --- /dev/null +++ b/authenticate @@ -0,0 +1 @@ +Subproject commit c61c883be061b86d38b87f4da302a76074c21956 diff --git a/crypto-conduit b/crypto-conduit new file mode 160000 index 00000000..26697093 --- /dev/null +++ b/crypto-conduit @@ -0,0 +1 @@ +Subproject commit 26697093384afe848b834270c58229dac822f70d diff --git a/package-list.sh b/package-list.sh index c461efb3..aa52f2ba 100644 --- a/package-list.sh +++ b/package-list.sh @@ -3,6 +3,8 @@ pkgs=( ./yesod-routes ./yesod-core ./yesod-json + ./crypto-conduit + ./authenticate/authenticate ./yesod-static ./yesod-persistent ./yesod-newsfeed diff --git a/yesod-auth/Yesod/Auth.hs b/yesod-auth/Yesod/Auth.hs index 93e8445e..ac93eec7 100644 --- a/yesod-auth/Yesod/Auth.hs +++ b/yesod-auth/Yesod/Auth.hs @@ -27,8 +27,6 @@ module Yesod.Auth , AuthException (..) ) where -#include "qq.h" - import Control.Monad (when) import Control.Monad.Trans.Maybe @@ -132,7 +130,7 @@ mkYesodSub "Auth" [ ClassP ''YesodAuth [VarT $ mkName "master"] ] #define STRINGS *Texts - [QQ(parseRoutes)| + [parseRoutes| /check CheckR GET /login LoginR GET /logout LogoutR GET POST @@ -151,7 +149,7 @@ setCreds doRedirects creds = do Nothing -> when doRedirects $ do case authRoute y of - Nothing -> do rh <- defaultLayout $ addHtml [QQ(shamlet)|

Invalid login |] + Nothing -> do rh <- defaultLayout $ addHtml [shamlet|

Invalid login |] sendResponse rh Just ar -> do setMessageI Msg.InvalidLogin redirect ar @@ -169,7 +167,7 @@ getCheckR = do addHtml $ html' creds) (jsonCreds creds) where html' creds = - [QQ(shamlet)| + [shamlet|

Authentication Status $maybe _ <- creds

Logged in. diff --git a/yesod-auth/Yesod/Auth/BrowserId.hs b/yesod-auth/Yesod/Auth/BrowserId.hs index 9b8fd429..7552af44 100644 --- a/yesod-auth/Yesod/Auth/BrowserId.hs +++ b/yesod-auth/Yesod/Auth/BrowserId.hs @@ -16,8 +16,6 @@ import Data.Maybe (fromMaybe) import Control.Monad.IO.Class (liftIO) import Control.Exception (throwIO) -#include "qq.h" - pid :: Text pid = "browserid" @@ -64,7 +62,7 @@ helper maudience = AuthPlugin _ -> notFound , apLogin = \toMaster -> do addScriptRemote browserIdJs - addHamlet [QQ(hamlet)| + addHamlet [hamlet|

diff --git a/yesod-auth/Yesod/Auth/Dummy.hs b/yesod-auth/Yesod/Auth/Dummy.hs index bd42c1bc..e9e66087 100644 --- a/yesod-auth/Yesod/Auth/Dummy.hs +++ b/yesod-auth/Yesod/Auth/Dummy.hs @@ -8,8 +8,6 @@ module Yesod.Auth.Dummy ( authDummy ) where -#include "qq.h" - import Yesod.Auth import Yesod.Form (runInputPost, textField, ireq) import Yesod.Handler (notFound) @@ -26,9 +24,9 @@ authDummy = dispatch _ _ = notFound url = PluginR "dummy" [] login authToMaster = - addHamlet [QQ(hamlet)| + addHamlet [hamlet|

- \Your new identifier is: + Your new identifier is: # |] diff --git a/yesod-auth/Yesod/Auth/Email.hs b/yesod-auth/Yesod/Auth/Email.hs index f1c45063..f70800ec 100644 --- a/yesod-auth/Yesod/Auth/Email.hs +++ b/yesod-auth/Yesod/Auth/Email.hs @@ -15,8 +15,6 @@ module Yesod.Auth.Email , isValidPass ) where -#include "qq.h" - import Network.Mail.Mime (randomString) import Yesod.Auth import System.Random @@ -82,7 +80,7 @@ class (YesodAuth m, PathPiece (AuthEmailId m)) => YesodAuthEmail m where authEmail :: YesodAuthEmail m => AuthPlugin m authEmail = AuthPlugin "email" dispatch $ \tm -> - [QQ(whamlet)| + [whamlet| @@ -116,7 +114,7 @@ getRegisterR = do defaultLayout $ do setTitleI Msg.RegisterLong addWidget - [QQ(whamlet)| + [whamlet|

_{Msg.EnterEmail}

_{Msg.ConfirmationEmailSent email} |] + [whamlet|

_{Msg.ConfirmationEmailSent email} |] getVerifyR :: YesodAuthEmail m => AuthEmailId m -> Text -> GHandler Auth m RepHtml @@ -168,7 +166,7 @@ getVerifyR lid key = do defaultLayout $ do setTitleI Msg.InvalidKey addWidget - [QQ(whamlet)|

_{Msg.InvalidKey} |] + [whamlet|

_{Msg.InvalidKey} |] postLoginR :: YesodAuthEmail master => GHandler Auth master () postLoginR = do @@ -207,7 +205,7 @@ getPasswordR = do defaultLayout $ do setTitleI Msg.SetPassTitle addWidget - [QQ(whamlet)| + [whamlet|

_{Msg.SetPass}

diff --git a/yesod-auth/Yesod/Auth/HashDB.hs b/yesod-auth/Yesod/Auth/HashDB.hs index 93be6f40..c80a8a47 100644 --- a/yesod-auth/Yesod/Auth/HashDB.hs +++ b/yesod-auth/Yesod/Auth/HashDB.hs @@ -72,8 +72,6 @@ module Yesod.Auth.HashDB , migrateUsers ) where -#include "qq.h" - import Yesod.Persist import Yesod.Handler import Yesod.Form @@ -179,7 +177,7 @@ postLoginR uniq = do (validateUser <$> (uniq =<< mu) <*> mp) if isValid then setCreds True $ Creds "hashdb" (fromMaybe "" mu) [] - else do setMessage [QQ(shamlet)| Invalid username/password |] + else do setMessage [shamlet| Invalid username/password |] toMaster <- getRouteToMaster redirect $ toMaster LoginR @@ -210,7 +208,7 @@ getAuthIdHashDB authR uniq creds = do -- user exists Just (Entity uid _) -> return $ Just uid Nothing -> do - setMessage [QQ(shamlet)| User not found |] + setMessage [shamlet| User not found |] redirect $ authR LoginR -- | Prompt for username and password, validate that against a database @@ -224,7 +222,7 @@ authHashDB :: ( YesodAuth m, YesodPersist m , PersistUnique b (GHandler Auth m)) => (Text -> Maybe (Unique user b)) -> AuthPlugin m authHashDB uniq = AuthPlugin "hashdb" dispatch $ \tm -> addHamlet - [QQ(hamlet)| + [hamlet|