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)
| 760 | // clearAuthCookies removes auth cookies (matches Node backend). |
| 761 | // Secure must match the original cookie for the browser to clear it. |
| 762 | func 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 | |
| 768 | func (h *AuthHandler) createToken(userID, role string, expSec int64, sessionID string) (string, error) { |
| 769 | claims := jwt.MapClaims{ |
no test coverage detected