Skip to content

Commit a7ce286

Browse files
Add a comment to link to gateway's persistUserBenefitsCookies (#13761)
1 parent e732876 commit a7ce286

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dotcom-rendering/src/client/userFeatures/user-features.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ const requestNewData = async () => {
3535
return syncDataFromUserBenefitsApi(authStatus).then(persistResponse);
3636
};
3737

38+
/**
39+
* Persist the user benefits response to cookies
40+
*
41+
* If new cookies are added/removed/edited, update the persistUserBenefitsCookie function in Gateway
42+
* https://github.com/guardian/gateway/blob/252b2b2f24be826da42c6e7c1b1e202594184023/src/server/lib/user-features.ts#L88
43+
*
44+
* In gateway, the cookies are set after authentication.
45+
*
46+
* @param {UserBenefits} userBenefitsResponse
47+
*/
3848
const persistResponse = (userBenefitsResponse: UserBenefits) => {
3949
createOrRenewCookie(USER_BENEFITS_EXPIRY_COOKIE);
4050
if (userBenefitsResponse.hideSupportMessaging) {

0 commit comments

Comments
 (0)