-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable consent or pay banner #13199
Enable consent or pay banner #13199
Conversation
Size Change: +1.22 kB (+0.14%) Total Size: 899 kB
ℹ️ View Unchanged
|
@@ -41,7 +41,6 @@ export type SignedInWithOkta = { | |||
}; | |||
|
|||
export type AuthStatus = | |||
| { kind: 'Pending' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this state is only relevant in the useAuthStatus
hook, where we initialise the value as "Pending" and set it asynchronously
// We must first allow reject all | ||
const expires = new Date(); | ||
expires.setMonth(expires.getMonth() + 6); | ||
await addCookie(context, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the setAllowRejectAllCookie
function in allowRejectAll.ts instead of reproducing the logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately this is quite playwright-specific (it uses a BrowserContext
object to set cookies)
dotcom-rendering/src/client/userFeatures/cookies/allowRejectAll.ts
Outdated
Show resolved
Hide resolved
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
dotcom-rendering/package.json
Outdated
@@ -47,7 +47,7 @@ | |||
"@guardian/eslint-config-typescript": "9.0.1", | |||
"@guardian/identity-auth": "2.1.0", | |||
"@guardian/identity-auth-frontend": "4.0.0", | |||
"@guardian/libs": "20.0.0", | |||
"@guardian/libs": "21.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a new version 21.1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomrf1 would you mind a giving me a walkthrough of this change please
@akinsola-guardian @tomrf1 as discussed I have a concern that new network requests to the members data API and within Sourcepoint, before we init CMP will mean a delay to consent state being provided to the app. This could in theory introduce a meaningful delay to the app initialising, commercial loading and ads being rendered and therefore a CWV and revenue impact. I appreciate this is unavoidable with the current implementation, but we should track I have verified that |
Seen on PROD (created by @tomrf1 and merged by @akinsola-guardian 7 minutes and 44 seconds ago) Please check your changes! |
Uses the new version of the cmp library which supports "consent or pay".
This means we now pass in two new parameters when initialising cmp with
cmp.init
.These are:
useNonAdvertisedList
- used to decide whether to show the reduced "non-advertised" list to users with the "reject all" benefit,isUserSignedIn
- used to decide whether or not to display the sign-in cta.This change takes place in the initialisation script, not a react component. We're adding a new
await
which may trigger a network call to Okta, to find out if the user is signed in. In practice this may mean that the consent banner takes longer to render. But it's important we have the correct value to avoid e.g. showing a sign-in link to a user who has just signed in.I've also done a small refactor of the
AuthStatus
type to simplify handling of the result of thegetAuthStatus
function. PreviouslyAuthStatus
could potentially be{ kind: 'Pending' }
. However, this is only relevant to theuseAuthStatus
hook, so I've moved it there.