Skip to content

Commit 874ffbb

Browse files
committed
Merge branch '2025-08-11-13-54-03' of github.com:gofiber/fiber into 2025-08-11-13-54-03
2 parents ca0d35a + bb41229 commit 874ffbb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/guide/context.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ app.Get("/form", func(c fiber.Ctx) error {
100100
```
101101

102102
```go title="Deleting a token"
103-
handler := csrf.HandlerFromContext(c)
104-
if handler != nil {
105-
_ = handler.DeleteToken(c)
106-
}
103+
app.Post("/logout", func(c fiber.Ctx) error {
104+
handler := csrf.HandlerFromContext(c)
105+
if handler != nil {
106+
// Invalidate the token on logout
107+
_ = handler.DeleteToken(c)
108+
}
109+
// ... other logout logic
110+
return c.SendString("Logged out")
111+
})
107112
```
108113

109114
### Session

0 commit comments

Comments
 (0)