From caf5bb2ee84079365996a622ab8fc5ed510ef9a7 Mon Sep 17 00:00:00 2001 From: T Date: Sat, 5 Jul 2025 09:41:47 -0600 Subject: Add Auth.Clear() method and enhance middlewares to clear invalid cookies - Add Auth.Clear() method that creates expired cookies (MaxAge: -1) to log out users - Enhance Clear() to remove existing Set-Cookie headers to comply with RFC 6265 - Update Required() and Optional() middlewares to automatically clear invalid cookies - Add comprehensive tests for all new functionality - Update documentation with Auth.Clear() usage examples --- doc.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 8d60f2a..12c314d 100644 --- a/doc.go +++ b/doc.go @@ -39,6 +39,9 @@ // user := UserData{ID: 123, Name: "John"} // auth.Set(w, user) // +// // Clear authentication cookie (logout) +// auth.Clear(w) +// // // Get authenticated data // user, ok := auth.Get(r.Context()) // -- cgit v1.2.3