From c28c989a18c5d7275ce439bc86aaaba7021ae569 Mon Sep 17 00:00:00 2001 From: jc <46619361+juancwu@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:07:06 -0500 Subject: [PATCH] change logout route request method from GET to POST --- backend/internal/tests/server_test.go | 2 +- backend/internal/v1/v1_auth/routes.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/tests/server_test.go b/backend/internal/tests/server_test.go index 9e00e56c..dcbfd919 100644 --- a/backend/internal/tests/server_test.go +++ b/backend/internal/tests/server_test.go @@ -486,7 +486,7 @@ func TestServer(t *testing.T) { assert.NotNil(t, tokenCookie) assert.NotEmpty(t, tokenCookie.Value) - req = httptest.NewRequest(http.MethodGet, "/api/v1/auth/logout", nil) + req = httptest.NewRequest(http.MethodPost, "/api/v1/auth/logout", nil) req.AddCookie(tokenCookie) rec = httptest.NewRecorder() diff --git a/backend/internal/v1/v1_auth/routes.go b/backend/internal/v1/v1_auth/routes.go index b0fb8ed7..4ef80d4d 100644 --- a/backend/internal/v1/v1_auth/routes.go +++ b/backend/internal/v1/v1_auth/routes.go @@ -40,5 +40,5 @@ func SetupAuthRoutes(e *echo.Group, s interfaces.CoreServer) { e.GET("/auth/verify", h.handleVerifyCookie) e.GET("/auth/verify-email", h.handleVerifyEmail, authLimiter.RateLimit()) e.POST("/auth/register", h.handleRegister, authLimiter.RateLimit()) - e.GET("/auth/logout", h.handleLogout, authLimiter.RateLimit()) + e.POST("/auth/logout", h.handleLogout, authLimiter.RateLimit()) }