From fc4b6e145457bc057b050170245d290b9b70fbe8 Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 20 Feb 2023 08:25:23 -0800 Subject: 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 --- endpoints.lisp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'endpoints.lisp') 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) -- cgit v1.2.3