Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: strict same site cookie (#17895)

p0nyece3f5d149dc
diff --git a/backend/api/auth/header.go b/backend/api/auth/header.go
index 7bc039a93c..a29e0ca290 100644
--- a/backend/api/auth/header.go
+++ b/backend/api/auth/header.go
@@ -47,10 +47,6 @@ func GetTokenCookie(ctx context.Context, stores *store.Store, licenseService *en
}
}
isHTTPS := strings.HasPrefix(origin, "https")
- sameSite := http.SameSiteStrictMode
- if isHTTPS {
- sameSite = http.SameSiteNoneMode
- }
tokenDuration := GetTokenDuration(ctx, stores, licenseService)
return &http.Cookie{
Name: AccessTokenCookieName,
@@ -66,7 +62,7 @@ func GetTokenCookie(ctx context.Context, stores *store.Store, licenseService *en
HttpOnly: true,
// See https://github.com/bytebase/bytebase/issues/31.
Secure: isHTTPS,
- SameSite: sameSite,
+ SameSite: http.SameSiteStrictMode,
}
}