Change the login form to a Bootstrapped one - still needs some colours tweaked though

This commit is contained in:
Danielle McLean 2017-10-06 12:32:27 +11:00
parent f934632484
commit ea47fb8b50
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
3 changed files with 33 additions and 2 deletions

View file

@ -12,7 +12,7 @@ import Database.Persist.Sql (ConnectionPool, runSqlPool)
import Text.Hamlet (hamletFile)
import Text.Jasmine (minifym)
import Yesod.Auth.HashDB (authHashDB)
import Yesod.Auth.HashDB (authHashDBWithForm)
import qualified Yesod.Auth.Message as AuthMsg
import Yesod.Default.Util (addStaticContentExternal)
@ -182,7 +182,11 @@ instance YesodAuth App where
toResult = UserError AuthMsg.InvalidLogin `maybe` (Authenticated . entityKey)
-- You can add other plugins like Google Email, email or OAuth here
authPlugins _ = [authHashDB (Just . UniqueUser)]
authPlugins _ = [authHashDBWithForm loginForm (Just . UniqueUser)]
where loginForm :: Route App -> Widget
loginForm action = do
mtok <- reqToken <$> getRequest
$(widgetFile "auth/login")
authHttpManager = getHttpManager
-- | Access function to determine if a user is logged in.