From 6e2a54820e1c99e17e72c4dab898dcebf6f59e83 Mon Sep 17 00:00:00 2001 From: ga Date: Thu, 20 Aug 2026 22:13:20 +0000 Subject: [PATCH] =?UTF-8?q?Auth:=20POST=20/api/v1/auth/logout=20=E2=80=94?= =?UTF-8?q?=20=D1=87=D0=B8=D1=81=D1=82=D0=B8=D1=82=20HttpOnly=20cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index ebd43cb..2fd2528 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -193,6 +193,14 @@ func main() { api.Post("/auth/register", registerLimiter, authH.Register) api.Post("/auth/login", loginLimiter, authH.Login) + api.Post("/auth/logout", func(c *fiber.Ctx) error { + // чистим cookie + c.Cookie(&fiber.Cookie{ + Name: "buhapp_at", Value: "", Path: "/", + MaxAge: -1, HTTPOnly: true, Secure: true, SameSite: "Lax", + }) + return c.JSON(fiber.Map{"ok": true}) + }) protected := api.Group("", auth.Middleware(authSvc)) protected.Get("/me", h.GetMe)