Skip to content

Commit

Permalink
Add example for logout.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdepillabout committed Aug 14, 2018
1 parent a6f63bf commit bfcdf61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example-servant-app/src/Lib.hs
Expand Up @@ -86,6 +86,7 @@ server sqlBackend =

getHomePage :: Maybe UserId -> Handler Html
getHomePage maybeUserId = do
-- liftIO $ "starting getHomePage"
pure $
html $ do
head $ title "Example Servant App"
Expand Down Expand Up @@ -123,6 +124,8 @@ getAfterLogin sqlBackend userId = do
h1 $ "Example Servant App for logged-in User"
h3 $ "Logged In User"
p $ toHtml $ "logged in as user: " <> show (unUserId userId)
p $
a ! href "http://localhost:3000/logout?next=http%3A%2F%2Flocalhost%3A3000" $ "logout"
h3 $ "Create Blog Post"
form ! method "POST" $ do
p $ do
Expand Down

0 comments on commit bfcdf61

Please sign in to comment.