Skip to content
Permalink
Browse files

posts: require authentication

  • Loading branch information...
3v0k4 committed Jul 21, 2019
1 parent aab5274 commit 9f97a457afdfb2c1fc7724dde990d650168783a7
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Foundation.hs
@@ -173,8 +173,8 @@ instance Yesod App where

isAuthorized LandingR _ = return Authorized

isAuthorized PostsR _ = return Authorized
isAuthorized (PostR _) _ = return Authorized
isAuthorized PostsR _ = isAuthenticated
isAuthorized (PostR _) _ = isAuthenticated

-- This function creates static content files in the static folder
-- and names them based on a hash of their content. This allows
@@ -272,7 +272,7 @@ isAuthenticated :: Handler AuthResult
isAuthenticated = do
muid <- maybeAuthId
return $ case muid of
Nothing -> Unauthorized "You must login to access this page"
Nothing -> AuthenticationRequired
Just _ -> Authorized

instance YesodAuthPersist App

0 comments on commit 9f97a45

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