1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-23 04:42:24 +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 -- 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 -- 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) -- “login” link instead)
Spock.get (authRoute <//> root) $ do Spock.get (authRoute <//> root) $ do
user <- getLoggedInUser user <- getLoggedInUser
if isJust user if isJust user
then Spock.redirect "auth/logout" then Spock.redirect "/auth/logout"
else Spock.redirect "auth/login" else Spock.redirect "/auth/login"
Spock.getpost (authRoute <//> "login") $ authRedirect "/" loginAction Spock.getpost (authRoute <//> "login") $ authRedirect "/" loginAction
Spock.get (authRoute <//> "logout") logoutAction Spock.get (authRoute <//> "logout") logoutAction
Spock.getpost (authRoute <//> "register") $ authRedirect "/" signupAction Spock.getpost (authRoute <//> "register") $ authRedirect "/" signupAction

View File

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