Merge pull request #27834 from overleaf/ii-domain-capture-not-in-group-redirect

[web] Redirect to domain capture page

GitOrigin-RevId: 15d2b8046beb5a40fc4937c337ee9655abaed8fd
This commit is contained in:
Jessica Lawshe
2025-08-19 10:18:29 -05:00
committed by Copybot
parent 9b90b5e823
commit 1aef3acca9
7 changed files with 107 additions and 4 deletions

View File

@@ -112,6 +112,29 @@ async function projectListPage(req, res, next) {
const isSaas = Features.hasFeature('saas')
const userId = SessionManager.getLoggedInUserId(req.session)
if (isSaas) {
const { variant: domainCaptureRedirect } =
await SplitTestHandler.promises.getAssignment(
req,
res,
'domain-capture-redirect'
)
if (domainCaptureRedirect === 'enabled') {
const subscription = (
await Modules.promises.hooks.fire(
'findDomainCaptureAndManagedUsersGroupUserShouldBePartOf',
userId
)
)?.[0]
if (subscription) {
return res.redirect('/domain-capture')
}
}
}
const projectsBlobPending = _getProjects(userId).catch(err => {
logger.err({ err, userId }, 'projects listing in background failed')
return undefined