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.",