Derive consent mode from geolocation, not banner config
The consent mode is now determined dynamically by the visitor's country and its applicable regulation. The configured consent_mode column is dropped from cookie_banners and added to cookie_consent_records to persist the geo-derived mode at consent-recording time. When no regulation matches, the default is OPT_OUT. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -440,7 +440,6 @@ func (r *mutationResolver) CreateCookieBanner(ctx context.Context, input types.C
|
||||
PrivacyPolicyURL: input.PrivacyPolicyURL,
|
||||
CookiePolicyURL: input.CookiePolicyURL,
|
||||
ConsentExpiryDays: input.ConsentExpiryDays,
|
||||
ConsentMode: input.ConsentMode,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -476,7 +475,6 @@ func (r *mutationResolver) UpdateCookieBanner(ctx context.Context, input types.U
|
||||
PrivacyPolicyURL: input.PrivacyPolicyURL,
|
||||
CookiePolicyURL: input.CookiePolicyURL,
|
||||
ConsentExpiryDays: input.ConsentExpiryDays,
|
||||
ConsentMode: input.ConsentMode,
|
||||
DefaultLanguage: input.DefaultLanguage,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -120,7 +120,6 @@ type CookieBanner implements Node {
|
||||
privacyPolicyUrl: String
|
||||
cookiePolicyUrl: String!
|
||||
consentExpiryDays: Int!
|
||||
consentMode: CookieConsentMode!
|
||||
showBranding: Boolean!
|
||||
defaultLanguage: String!
|
||||
|
||||
@@ -528,7 +527,6 @@ input CreateCookieBannerInput {
|
||||
privacyPolicyUrl: String
|
||||
cookiePolicyUrl: String!
|
||||
consentExpiryDays: Int!
|
||||
consentMode: CookieConsentMode!
|
||||
}
|
||||
|
||||
input UpdateCookieBannerInput {
|
||||
@@ -537,7 +535,6 @@ input UpdateCookieBannerInput {
|
||||
privacyPolicyUrl: String
|
||||
cookiePolicyUrl: String
|
||||
consentExpiryDays: Int
|
||||
consentMode: CookieConsentMode
|
||||
defaultLanguage: String
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ func NewCookieBanner(b *coredata.CookieBanner) *CookieBanner {
|
||||
PrivacyPolicyURL: b.PrivacyPolicyURL,
|
||||
CookiePolicyURL: b.CookiePolicyURL,
|
||||
ConsentExpiryDays: b.ConsentExpiryDays,
|
||||
ConsentMode: b.ConsentMode,
|
||||
ShowBranding: b.ShowBranding,
|
||||
DefaultLanguage: b.DefaultLanguage,
|
||||
CreatedAt: b.CreatedAt,
|
||||
|
||||
Reference in New Issue
Block a user