mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user