MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / clearAuthCookies

Function clearAuthCookies

server-source-code/internal/handler/auth.go:762–766  ·  view source on GitHub ↗

clearAuthCookies removes auth cookies (matches Node backend). Secure must match the original cookie for the browser to clear it.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

760// clearAuthCookies removes auth cookies (matches Node backend).
761// Secure must match the original cookie for the browser to clear it.
762func clearAuthCookies(w http.ResponseWriter, r *http.Request) {
763 secure := isSecureRequest(r)
764 http.SetCookie(w, &http.Cookie{Name: "token", Value: "", Path: "/", MaxAge: -1, HttpOnly: true, Secure: secure})
765 http.SetCookie(w, &http.Cookie{Name: "refresh_token", Value: "", Path: "/", MaxAge: -1, HttpOnly: true, Secure: secure})
766}
767
768func (h *AuthHandler) createToken(userID, role string, expSec int64, sessionID string) (string, error) {
769 claims := jwt.MapClaims{

Callers 2

LogoutMethod · 0.85
LogoutMethod · 0.85

Calls 1

isSecureRequestFunction · 0.85

Tested by

no test coverage detected