loginHandler

This commit is contained in:
Michael Snoyman 2010-10-11 19:46:48 +02:00
parent 18e901fa52
commit f0cd04fa97
2 changed files with 9 additions and 5 deletions

View File

@ -62,6 +62,13 @@ class Yesod m => YesodAuth m where
authPlugins :: [AuthPlugin m]
-- | What to show on the login page.
loginHandler :: GHandler Auth m RepHtml
loginHandler = defaultLayout $ do
setTitle $ string "Login"
tm <- liftHandler getRouteToMaster
mapM_ (flip apLogin tm) authPlugins
mkYesodSub "Auth"
[ ClassP ''YesodAuth [VarT $ mkName "master"]
] [$parseRoutes|
@ -120,10 +127,7 @@ $nothing
]
getLoginR :: YesodAuth m => GHandler Auth m RepHtml
getLoginR = defaultLayout $ do
setTitle $ string "Login"
tm <- liftHandler getRouteToMaster
mapM_ (flip apLogin tm) authPlugins
getLoginR = loginHandler
getLogoutR :: YesodAuth m => GHandler Auth m ()
getLogoutR = postLogoutR -- FIXME redirect to post

View File

@ -1,5 +1,5 @@
name: yesod-auth
version: 0.1.2
version: 0.1.3
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>