updated csrf cookie

This commit is contained in:
yasarm 2022-12-13 17:30:21 +05:30
parent 4d48346f21
commit c34682087e
1 changed files with 7 additions and 2 deletions

View File

@ -445,16 +445,21 @@ func (p *OAuthProxy) makeCookie(req *http.Request, name string, value string, ex
}
}
return &http.Cookie{
c := &http.Cookie{
Name: name,
Value: value,
Path: p.CookiePath,
Domain: cookieDomain,
HttpOnly: p.CookieHTTPOnly,
Secure: p.CookieSecure,
Expires: now.Add(expiration),
SameSite: cookies.ParseSameSite(p.CookieSameSite),
}
if expiration != time.Duration(0) {
c.Expires = now.Add(expiration)
}
return c
}
// ClearCSRFCookie creates a cookie to unset the CSRF cookie stored in the user's