From a98c3eb7575c79f86ff8e43b8d9f2d14bfd9af66 Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Aug 2017 20:10:51 +0300 Subject: [PATCH] Roll back some overzealous route fixing Not all routes need /haskell/ --- src/Guide/Main.hs | 6 +++--- src/Guide/Routes.hs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Guide/Main.hs b/src/Guide/Main.hs index 0371f3b..afd16b9 100644 --- a/src/Guide/Main.hs +++ b/src/Guide/Main.hs @@ -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 diff --git a/src/Guide/Routes.hs b/src/Guide/Routes.hs index 2c79ac6..219bfeb 100644 --- a/src/Guide/Routes.hs +++ b/src/Guide/Routes.hs @@ -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"