updated csrf cookie
This commit is contained in:
parent
4d48346f21
commit
c34682087e
|
|
@ -445,16 +445,21 @@ func (p *OAuthProxy) makeCookie(req *http.Request, name string, value string, ex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &http.Cookie{
|
c := &http.Cookie{
|
||||||
Name: name,
|
Name: name,
|
||||||
Value: value,
|
Value: value,
|
||||||
Path: p.CookiePath,
|
Path: p.CookiePath,
|
||||||
Domain: cookieDomain,
|
Domain: cookieDomain,
|
||||||
HttpOnly: p.CookieHTTPOnly,
|
HttpOnly: p.CookieHTTPOnly,
|
||||||
Secure: p.CookieSecure,
|
Secure: p.CookieSecure,
|
||||||
Expires: now.Add(expiration),
|
|
||||||
SameSite: cookies.ParseSameSite(p.CookieSameSite),
|
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
|
// ClearCSRFCookie creates a cookie to unset the CSRF cookie stored in the user's
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue