fix(auth): update SameSite cookie policy description for clarity
This commit is contained in:
@@ -128,7 +128,8 @@ func isLocalRequest(c *gin.Context) bool {
|
|||||||
// setSecureCookie sets an auth cookie with security best practices
|
// setSecureCookie sets an auth cookie with security best practices
|
||||||
// - HttpOnly: prevents JavaScript access (XSS protection)
|
// - HttpOnly: prevents JavaScript access (XSS protection)
|
||||||
// - Secure: true for HTTPS; false for local/private network HTTP requests
|
// - Secure: true for HTTPS; false for local/private network HTTP requests
|
||||||
// - SameSite: Strict for HTTPS, Lax for HTTP/IP to allow forward-auth redirects
|
// - SameSite: Lax for any local/private-network request (regardless of scheme),
|
||||||
|
// Strict otherwise (public HTTPS only)
|
||||||
func setSecureCookie(c *gin.Context, name, value string, maxAge int) {
|
func setSecureCookie(c *gin.Context, name, value string, maxAge int) {
|
||||||
scheme := requestScheme(c)
|
scheme := requestScheme(c)
|
||||||
secure := true
|
secure := true
|
||||||
|
|||||||
Reference in New Issue
Block a user