Auth: POST /api/v1/auth/logout — чистит HttpOnly cookie
This commit is contained in:
parent
0c1de393d2
commit
6e2a54820e
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user