From 6ac37cfe659f827a14741e6d961a7241ecefccfc Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 19 Mar 2024 11:05:51 -0400 Subject: [PATCH] refactor: add no cache headers --- account/jwt.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/account/jwt.go b/account/jwt.go index 62c87cd..6d85d07 100644 --- a/account/jwt.go +++ b/account/jwt.go @@ -166,6 +166,10 @@ func ClearAuthCookie(jc jape.Context, apiName string) { continue } + jc.ResponseWriter.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + jc.ResponseWriter.Header().Set("Pragma", "no-cache") + jc.ResponseWriter.Header().Set("Expires", "0") + http.SetCookie(jc.ResponseWriter, &http.Cookie{ Name: routeableApi.AuthTokenName(), Value: "deleted", @@ -175,5 +179,6 @@ func ClearAuthCookie(jc jape.Context, apiName string) { Path: "/", Domain: routeableApi.Domain(), }) + } }