1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-22 20:31:31 +03:00

Roll back some overzealous route fixing

Not all routes need /haskell/
This commit is contained in:
Artyom 2017-08-13 20:10:51 +03:00
parent 4ad47ec6f9
commit a98c3eb757
No known key found for this signature in database
GPG Key ID: B8E35A33FF522710
2 changed files with 5 additions and 5 deletions

View File

@ -314,13 +314,13 @@ guideApp waiMetrics = do
-- plain "/auth" logs out a logged-in user and lets a logged-out user
-- log in (this is not the best idea, granted, and we should just
-- shot logged-in users a “logout” link and logged-out users a
-- show logged-in users a “logout” link and logged-out users a
-- “login” link instead)
Spock.get (authRoute <//> root) $ do
user <- getLoggedInUser
if isJust user
then Spock.redirect "auth/logout"
else Spock.redirect "auth/login"
then Spock.redirect "/auth/logout"
else Spock.redirect "/auth/login"
Spock.getpost (authRoute <//> "login") $ authRedirect "/" loginAction
Spock.get (authRoute <//> "logout") logoutAction
Spock.getpost (authRoute <//> "register") $ authRedirect "/" signupAction

View File

@ -24,7 +24,7 @@ haskellRoute :: Path '[] 'Open
haskellRoute = "haskell"
authRoute :: Path '[] 'Open
authRoute = haskellRoute <//> "auth"
authRoute = "auth"
setRoute :: Path '[] 'Open
setRoute = haskellRoute <//> "set"
@ -45,4 +45,4 @@ renderRoute :: Path '[] 'Open
renderRoute = haskellRoute <//> "render"
adminRoute :: Path '[] 'Open
adminRoute = haskellRoute <//> "admin"
adminRoute = "admin"