diff --git a/internal/api/handler.go b/internal/api/handler.go index 36685109..a78397e6 100644 --- a/internal/api/handler.go +++ b/internal/api/handler.go @@ -56,6 +56,7 @@ func NewHandler() *gin.Engine { v1Auth.GET("/callback", authApi.Callback) v1Auth.POST("/callback", authApi.Callback) v1Auth.POST("/logout", authApi.Logout) + v1Auth.GET("/logout", authApi.Logout) } } diff --git a/internal/api/v1/auth/logout.go b/internal/api/v1/auth/logout.go index 2ec2c3f2..392a7118 100644 --- a/internal/api/v1/auth/logout.go +++ b/internal/api/v1/auth/logout.go @@ -13,6 +13,7 @@ import ( // @Produce plain // @Success 302 {string} string "Redirects to home page" // @Router /auth/logout [post] +// @Router /auth/logout [get] func Logout(c *gin.Context) { auth.GetDefaultAuth().LogoutHandler(c.Writer, c.Request) } diff --git a/internal/api/v1/docs/swagger.json b/internal/api/v1/docs/swagger.json index 0413cadf..bd55bd96 100644 --- a/internal/api/v1/docs/swagger.json +++ b/internal/api/v1/docs/swagger.json @@ -285,6 +285,26 @@ } }, "/auth/logout": { + "get": { + "description": "Logs out the user by invalidating the token", + "produces": [ + "text/plain" + ], + "tags": [ + "auth" + ], + "summary": "Logout", + "responses": { + "302": { + "description": "Redirects to home page", + "schema": { + "type": "string" + } + } + }, + "x-id": "logout", + "operationId": "logout" + }, "post": { "description": "Logs out the user by invalidating the token", "produces": [ diff --git a/internal/api/v1/docs/swagger.yaml b/internal/api/v1/docs/swagger.yaml index dd39c122..cda02adb 100644 --- a/internal/api/v1/docs/swagger.yaml +++ b/internal/api/v1/docs/swagger.yaml @@ -1613,6 +1613,19 @@ paths: - auth x-id: login /auth/logout: + get: + description: Logs out the user by invalidating the token + produces: + - text/plain + responses: + "302": + description: Redirects to home page + schema: + type: string + summary: Logout + tags: + - auth + x-id: logout post: description: Logs out the user by invalidating the token produces: