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:
parent
4ad47ec6f9
commit
a98c3eb757
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user