summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-02-20 08:25:23 -0800
committercolin <colin@cicadas.surf>2023-02-20 08:25:23 -0800
commitfc4b6e145457bc057b050170245d290b9b70fbe8 (patch)
treed7e4da6c1550dabe299c260c8689d5e4ad936be8
parentab5aa5bbe2a74fd83cd8f49c85595cdb25f34667 (diff)
Modify: redirect to /tavern from /
If you are logged in, this makes sense, you'll land in the tavern. If you are not logged in, then you'll be redirected by the handler for /tavern to the /tavern-door. This is to avoid having to navigate to /tavern manually when you revisit dnd
-rw-r--r--endpoints.lisp11
1 files changed, 6 insertions, 5 deletions
diff --git a/endpoints.lisp b/endpoints.lisp
index f734e37..788dc2d 100644
--- a/endpoints.lisp
+++ b/endpoints.lisp
@@ -29,6 +29,7 @@ I.e. It should be called within the scope of a request handler."
(let ((session (or session (gensym "SESSION"))))
`(a:if-let (,session (current-session))
(let ((,player (session-player ,session)))
+ (declare (ignorable ,player))
,@body)
(redirect-to ,redirect))))
@@ -37,7 +38,7 @@ I.e. It should be called within the scope of a request handler."
(defendpoint* :get "/" () ()
- (redirect-to "/tavern-door"))
+ (redirect-to "/tavern"))
(defendpoint* :get "/tavern-door" () ()
"Tavern door is where the player logs into the system."
@@ -70,16 +71,16 @@ I.e. It should be called within the scope of a request handler."
(register-player nick)
(redirect-to "/tavern-door")))
-(defendpoint* :get "/godess-shrine" () ()
- (godess-shrine))
-
-
;;; SESSION ENDPOINTS
(defendpoint* :get "/tavern" () ()
(with-session (player)
(tavern player)))
+(defendpoint* :get "/godess-shrine" () ()
+ (with-session (player)
+ (godess-shrine)))
+
(defendpoint* :post "/godess-shrine" () ()
(with-session (player)
(with-plist ((name :name)) (lzb:request-body)