Skip to content

Commit

Permalink
Change logout route request method from GET to POST (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu authored Dec 24, 2024
2 parents fcefb34 + c28c989 commit 52f0d7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/internal/tests/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion backend/internal/v1/v1_auth/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 52f0d7a

Please sign in to comment.