Add banner ID to probo_consent cookie
Include a `bid` field in the consent cookie so it explicitly identifies which cookie banner it belongs to, making validation direct instead of relying on the visitor ID as an implicit discriminator. Existing cookies without `bid` self-heal on the next load by falling through to the API fetch. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -110,6 +110,7 @@ type (
|
||||
UserAgent *string
|
||||
ConsentData json.RawMessage
|
||||
Action coredata.CookieConsentAction
|
||||
SdkVersion string
|
||||
}
|
||||
|
||||
RecordConsentRequest struct {
|
||||
@@ -119,6 +120,7 @@ type (
|
||||
UserAgent *string
|
||||
ConsentData json.RawMessage
|
||||
Action coredata.CookieConsentAction
|
||||
SdkVersion string
|
||||
}
|
||||
|
||||
DetectedCookie struct {
|
||||
@@ -1675,6 +1677,7 @@ func (s *Service) CreateCookieConsentRecord(
|
||||
UserAgent: req.UserAgent,
|
||||
ConsentData: req.ConsentData,
|
||||
Action: req.Action,
|
||||
SdkVersion: req.SdkVersion,
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
|
||||
@@ -2060,6 +2063,7 @@ func (s *Service) RecordConsent(
|
||||
UserAgent: req.UserAgent,
|
||||
ConsentData: req.ConsentData,
|
||||
Action: req.Action,
|
||||
SdkVersion: req.SdkVersion,
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user