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)