diff --git a/yesod-bin/ChangeLog.md b/yesod-bin/ChangeLog.md index fe7eb498..ec00369c 100644 --- a/yesod-bin/ChangeLog.md +++ b/yesod-bin/ChangeLog.md @@ -1,3 +1,7 @@ +## 1.4.10 + +* Scaffolding update + ## 1.4.9.2 * Collapse paths in keter bundles, see [mailing list thread](https://groups.google.com/d/msg/yesodweb/Ndd310qfSEc/pZOXldsKowsJ) diff --git a/yesod-bin/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles index f810c380..e974c9d4 100644 --- a/yesod-bin/hsfiles/mongo.hsfiles +++ b/yesod-bin/hsfiles/mongo.hsfiles @@ -206,6 +206,7 @@ import Import.NoFoundation import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Yesod.Auth.BrowserId (authBrowserId) +import Yesod.Auth.Message (AuthMessage (InvalidLogin)) import Yesod.Core.Types (Logger) import Yesod.Default.Util (addStaticContentExternal) import qualified Yesod.Core.Unsafe as Unsafe @@ -232,6 +233,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -323,14 +328,11 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - getAuthId creds = runDB $ do + authenticate creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds - case x of - Just (Entity uid _) -> return $ Just uid - Nothing -> Just <$> insert User - { userIdent = credsIdent creds - , userPassword = Nothing - } + return $ case x of + Just (Entity uid _) -> Authenticated uid + Nothing -> UserError InvalidLogin -- You can add other plugins like BrowserID, email or OAuth here authPlugins _ = [authBrowserId def] @@ -940,6 +942,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles index 7565bc63..2e719704 100644 --- a/yesod-bin/hsfiles/mysql.hsfiles +++ b/yesod-bin/hsfiles/mysql.hsfiles @@ -224,6 +224,7 @@ import Database.Persist.Sql (ConnectionPool, runSqlPool) import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Yesod.Auth.BrowserId (authBrowserId) +import Yesod.Auth.Message (AuthMessage (InvalidLogin)) import Yesod.Default.Util (addStaticContentExternal) import Yesod.Core.Types (Logger) import qualified Yesod.Core.Unsafe as Unsafe @@ -250,6 +251,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -340,14 +345,11 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - getAuthId creds = runDB $ do + authenticate creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds - case x of - Just (Entity uid _) -> return $ Just uid - Nothing -> Just <$> insert User - { userIdent = credsIdent creds - , userPassword = Nothing - } + return $ case x of + Just (Entity uid _) -> Authenticated uid + Nothing -> UserError InvalidLogin -- You can add other plugins like BrowserID, email or OAuth here authPlugins _ = [authBrowserId def] @@ -952,6 +954,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles index dc2073c6..b60059ce 100644 --- a/yesod-bin/hsfiles/postgres-fay.hsfiles +++ b/yesod-bin/hsfiles/postgres-fay.hsfiles @@ -229,6 +229,7 @@ import Database.Persist.Sql (ConnectionPool, runSqlPool) import Import.NoFoundation import Text.Hamlet (hamletFile) import Yesod.Auth.BrowserId (authBrowserId) +import Yesod.Auth.Message (AuthMessage (InvalidLogin)) import qualified Yesod.Core.Unsafe as Unsafe import Yesod.Core.Types (Logger) import Yesod.Default.Util (addStaticContentExternal) @@ -257,6 +258,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -356,14 +361,11 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - getAuthId creds = runDB $ do + authenticate creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds - case x of - Just (Entity uid _) -> return $ Just uid - Nothing -> Just <$> insert User - { userIdent = credsIdent creds - , userPassword = Nothing - } + return $ case x of + Just (Entity uid _) -> Authenticated uid + Nothing -> UserError InvalidLogin -- You can add other plugins like BrowserID, email or OAuth here authPlugins _ = [authBrowserId def] @@ -565,7 +567,7 @@ library , yesod-static >= 1.4.0.3 && < 1.5 , yesod-form >= 1.4.0 && < 1.5 , yesod-fay >= 0.7 && < 0.8 - , fay >= 0.21.2.1 && < 0.22 + , fay >= 0.21.2.1 && < 0.24 , classy-prelude >= 0.10.2 , classy-prelude-conduit >= 0.10.2 , classy-prelude-yesod >= 0.10.2 @@ -1011,6 +1013,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles index 42dbc0f3..646add02 100644 --- a/yesod-bin/hsfiles/postgres.hsfiles +++ b/yesod-bin/hsfiles/postgres.hsfiles @@ -224,6 +224,7 @@ import Database.Persist.Sql (ConnectionPool, runSqlPool) import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Yesod.Auth.BrowserId (authBrowserId) +import Yesod.Auth.Message (AuthMessage (InvalidLogin)) import Yesod.Default.Util (addStaticContentExternal) import Yesod.Core.Types (Logger) import qualified Yesod.Core.Unsafe as Unsafe @@ -250,6 +251,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -340,14 +345,11 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - getAuthId creds = runDB $ do + authenticate creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds - case x of - Just (Entity uid _) -> return $ Just uid - Nothing -> Just <$> insert User - { userIdent = credsIdent creds - , userPassword = Nothing - } + return $ case x of + Just (Entity uid _) -> Authenticated uid + Nothing -> UserError InvalidLogin -- You can add other plugins like BrowserID, email or OAuth here authPlugins _ = [authBrowserId def] @@ -952,6 +954,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles index 67787c08..540ed990 100644 --- a/yesod-bin/hsfiles/simple.hsfiles +++ b/yesod-bin/hsfiles/simple.hsfiles @@ -220,6 +220,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -853,6 +857,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles index 2c90217c..019e3c4c 100644 --- a/yesod-bin/hsfiles/sqlite.hsfiles +++ b/yesod-bin/hsfiles/sqlite.hsfiles @@ -224,6 +224,7 @@ import Database.Persist.Sql (ConnectionPool, runSqlPool) import Text.Hamlet (hamletFile) import Text.Jasmine (minifym) import Yesod.Auth.BrowserId (authBrowserId) +import Yesod.Auth.Message (AuthMessage (InvalidLogin)) import Yesod.Default.Util (addStaticContentExternal) import Yesod.Core.Types (Logger) import qualified Yesod.Core.Unsafe as Unsafe @@ -250,6 +251,10 @@ instance HasHttpManager App where -- Note that this is really half the story; in Application.hs, mkYesodDispatch -- generates the rest of the code. Please see the linked documentation for an -- explanation for this split. +-- +-- This function also generates the following type synonyms: +-- type Handler = HandlerT App IO +-- type Widget = WidgetT App IO () mkYesodData "App" $(parseRoutesFile "config/routes") -- | A convenient synonym for creating forms. @@ -340,14 +345,11 @@ instance YesodAuth App where -- Override the above two destinations when a Referer: header is present redirectToReferer _ = True - getAuthId creds = runDB $ do + authenticate creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds - case x of - Just (Entity uid _) -> return $ Just uid - Nothing -> Just <$> insert User - { userIdent = credsIdent creds - , userPassword = Nothing - } + return $ case x of + Just (Entity uid _) -> Authenticated uid + Nothing -> UserError InvalidLogin -- You can add other plugins like BrowserID, email or OAuth here authPlugins _ = [authBrowserId def] @@ -952,6 +954,12 @@ stanzas: # keter`. Uses `scp` internally, so you can set it to a remote destination # copy-to: user@host:/opt/keter/incoming +# You can pass arguments to `scp` used above. This example limits bandwidth to +# 1024 Kbit/s and uses port 2222 instead of the default 22 +# copy-to-args: +# - "-l 1024" +# - "-P 2222" + # If you would like to have Keter automatically create a PostgreSQL database # and set appropriate environment variables for it to be discovered, uncomment # the following line. diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index c184ee7d..efe7c219 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.4.9.2 +version: 1.4.10 license: MIT license-file: LICENSE author: Michael Snoyman