From 431e850dc884fa40c2d92a6f3f6537378c4dffd5 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe <5312836+lawshe@users.noreply.github.com> Date: Mon, 22 Sep 2025 09:56:05 -0500 Subject: [PATCH] Merge pull request #28373 from overleaf/jel-testing-session-for-domain-capture [web] Testing domain capture before enabling GitOrigin-RevId: 6ac62b39eedad613748a680aa26624126db8e1c1 --- services/web/app/src/infrastructure/JsonWebToken.js | 7 +++++++ services/web/app/src/router.mjs | 1 + services/web/frontend/js/utils/meta.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/services/web/app/src/infrastructure/JsonWebToken.js b/services/web/app/src/infrastructure/JsonWebToken.js index 0a49e97062..8ce7c78ba4 100644 --- a/services/web/app/src/infrastructure/JsonWebToken.js +++ b/services/web/app/src/infrastructure/JsonWebToken.js @@ -14,8 +14,15 @@ async function sign(payload, options = {}) { return token } +function getDecoded(token) { + const key = Settings.jwt.key + const decoded = JWT.verify(token, key) + return decoded +} + module.exports = { sign: callbackify(sign), + getDecoded, promises: { sign, }, diff --git a/services/web/app/src/router.mjs b/services/web/app/src/router.mjs index b856a23d75..2368d61110 100644 --- a/services/web/app/src/router.mjs +++ b/services/web/app/src/router.mjs @@ -506,6 +506,7 @@ async function initialize(webRouter, privateApiRouter, publicApiRouter) { AuthenticationController.requireLogin(), RateLimiterMiddleware.rateLimit(rateLimiters.openDashboard), AsyncLocalStorage.middleware, + await Modules.middleware('domainCaptureTestSession'), PermissionsController.useCapabilities(), ProjectListController.projectListPage ) diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index c01bed5fab..993dba604c 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -113,6 +113,7 @@ export interface Meta { 'ol-detachRole': 'detached' | 'detacher' | '' 'ol-dictionariesRoot': 'string' 'ol-domainCaptureEnabled': boolean | undefined + 'ol-domainCaptureTestURL': string | undefined 'ol-dropbox': { error: boolean; registered: boolean } 'ol-editorThemes': string[] 'ol-email': string