refactor: add no cache headers

This commit is contained in:
Derrick Hammer 2024-03-19 11:05:51 -04:00
parent ac61279081
commit 6ac37cfe65
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 0 deletions

View File

@ -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(),
})
}
}