Skip to content
Permalink
Browse files

login: use authDummy for login

  • Loading branch information...
3v0k4 committed Jul 21, 2019
1 parent 4fea7c6 commit 76c4347cdf4f563e9f543e83e5558848d29826a5
Showing with 6 additions and 8 deletions.
  1. +5 −5 src/Foundation.hs
  2. +1 −3 src/Handler/Landing.hs
@@ -242,13 +242,13 @@ instance YesodAuth App where

-- Where to send a user after successful login
loginDest :: App -> Route App
loginDest _ = HomeR
loginDest _ = PostsR
-- Where to send a user after logout
logoutDest :: App -> Route App
logoutDest _ = HomeR
-- Override the above two destinations when a Referer: header is present
redirectToReferer :: App -> Bool
redirectToReferer _ = True
redirectToReferer _ = False

authenticate :: (MonadHandler m, HandlerSite m ~ App)
=> Creds App -> m (AuthenticationResult App)
@@ -261,11 +261,11 @@ instance YesodAuth App where
, userPassword = Nothing
}

authLayout = liftHandler . emptyLayout

-- You can add other plugins like Google Email, email or OAuth here
authPlugins :: App -> [AuthPlugin App]
authPlugins app = [authOpenId Claimed []] ++ extraAuthPlugins
-- Enable authDummy login if enabled.
where extraAuthPlugins = [authDummy | appAuthDummyLogin $ appSettings app]
authPlugins _app = [authDummy]

-- | Access function to determine if a user is logged in.
isAuthenticated :: Handler AuthResult
@@ -21,9 +21,7 @@ loginForm =

getLandingR :: Handler Html
getLandingR = do
(widget, enctype) <- generateFormPost loginForm
emptyLayout $ do
$(widgetFile "landing")
redirect $ AuthR LoginR

postLandingR :: Handler Html
postLandingR = do

0 comments on commit 76c4347

Please sign in to comment.
You can’t perform that action at this time.