From 43832b7a4349c5c8509145f3c0502263218aa673 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Wed, 18 Feb 2026 16:13:48 +0100 Subject: [PATCH] [web] Remove CIAM login notification and cookie (#31563) * Remove legacy notification cookies * Remove CIAM notification message from login page * Remove e2e test "it can dismiss the login notification" * Clarify comment about removing legacy notification dismiss cookies GitOrigin-RevId: 33fdc02a397c0f4be491f030ab58fd8954276048 --- .../web/app/src/infrastructure/ExpressLocals.mjs | 16 +++++++++++++++- services/web/locales/en.json | 1 - 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/services/web/app/src/infrastructure/ExpressLocals.mjs b/services/web/app/src/infrastructure/ExpressLocals.mjs index dede4db7be..65bb04b485 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.mjs +++ b/services/web/app/src/infrastructure/ExpressLocals.mjs @@ -338,11 +338,25 @@ export default async function (webRouter, privateApiRouter, publicApiRouter) { }) webRouter.use(function (req, res, next) { + // Notifications that are no longer used for which we want to remove the dismiss cookies. + // This can be removed after some time + const LEGACY_NOTIFICATIONS = [{ id: 'ciaminfo', paths: ['/login'] }] + const KEY_PREFIX = 'readnotif-' const dismissedNotifications = [] for (const cookieName in req.cookies) { if (cookieName.startsWith(KEY_PREFIX)) { - dismissedNotifications.push(cookieName.slice(KEY_PREFIX.length)) + const legacyNotification = LEGACY_NOTIFICATIONS.find( + ({ id }) => cookieName === `${KEY_PREFIX}${id}` + ) + if (legacyNotification) { + // Remove the cookie for legacy notifications that we no longer use. + for (const path of legacyNotification.paths) { + res.clearCookie(cookieName, { path, domain: Settings.cookieDomain }) + } + } else { + dismissedNotifications.push(cookieName.slice(KEY_PREFIX.length)) + } } } res.locals.dismissedNotifications = dismissedNotifications diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 678916d5bd..b3cbb19ae7 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -345,7 +345,6 @@ "choose_how_you_search_your_references": "Choose how you search your references", "choose_which_experiments": "Choose which experiments you’d like to try.", "choose_your_plan": "Choose your plan", - "ciam_info_login": "We’re making some changes to improve your login experience. You’ll start seeing a new look, including mentions of our parent company, Digital Science. Don’t worry, this won’t change your account or login options.", "citation": "Citation", "citation_checks_are_powered_by_trusted_sources_from_dimensions": "Citation checks are powered by trusted sources from Dimensions.", "cite_a_reference_from_your_reference_manager_to_automatically_add_it_to_your_bib_file": "Cite a reference from your reference manager to automatically add it to your .bib file.",