Skip to content
Permalink
Browse files

login: go to posts only if user exist in db

  • Loading branch information...
3v0k4 committed Jul 20, 2019
1 parent 1ec890d commit b90b5cc29b053ed900a8b395b097688264388ebf
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/Handler/Landing.hs
@@ -29,8 +29,15 @@ postLandingR :: Handler Html
postLandingR = do
((result, widget), enctype) <- runFormPost loginForm
case result of
FormSuccess _ ->
redirect PostsR
FormSuccess login -> do
user <- runDB $ selectList [ UserIdent ==. username login, UserPassword ==. Just (password login) ] []
case user of
[] ->
emptyLayout $ do
$(widgetFile "landing")

_ ->
redirect PostsR
_ ->
emptyLayout $ do
$(widgetFile "landing")

0 comments on commit b90b5cc

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