Merge onboarding experiments integration branch (#9571)
* Add onboarding survey page * Add onboarding new analytics events to mixpanel allowlist * [web] Try Premium prompt * moved try-premium code to overleaf-integration * fixed sheet styling * Add onboarding flow redirect handling to registration handlers (#9462) * Add redirect logic for onboarding flow after registration * Update UPGRADE_PROMPT_URL * Cleanup style of OverleafAuthenticationController * Refactor finishLogin calls to call wrapped function in OverleafAuthenticationController * Refactor user properties/onboarding flow redirect into finishLogin wrapper * Fix async/await calls after refactoring * Update tests for finishLogin refactoring * Don't redirect to upgrade prompt if user has premium via commons Co-authored-by: Miguel Serrano <mserranom@users.noreply.github.com> GitOrigin-RevId: 7c392aa6949f99fa909f9ca4e4baad4c4d4ff6be
This commit is contained in:
committed by
Copybot
co-authored by
Miguel Serrano
parent
a0fabee3b4
commit
db9fad7cf8
@@ -263,6 +263,8 @@ async function interstitialPaymentPage(req, res) {
|
||||
const hasSubscription =
|
||||
await LimitationsManager.promises.userHasV1OrV2Subscription(user)
|
||||
|
||||
const showSkipLink = req.query?.skipLink === 'true'
|
||||
|
||||
if (hasSubscription) {
|
||||
res.redirect('/user/subscription?hasSubscription=true')
|
||||
} else {
|
||||
@@ -272,6 +274,7 @@ async function interstitialPaymentPage(req, res) {
|
||||
itm_campaign: req.query?.itm_campaign,
|
||||
recommendedCurrency,
|
||||
interstitialPaymentConfig,
|
||||
showSkipLink,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -339,6 +342,8 @@ async function successfulSubscription(req, res) {
|
||||
const premiumFeaturesDiscoverability =
|
||||
premiumFeaturesDiscoverabilityAssignment?.variant === 'active'
|
||||
|
||||
const postCheckoutRedirect = req.session?.postCheckoutRedirect
|
||||
|
||||
if (!personalSubscription) {
|
||||
res.redirect('/user/subscription/plans')
|
||||
} else {
|
||||
@@ -346,6 +351,7 @@ async function successfulSubscription(req, res) {
|
||||
title: 'thank_you',
|
||||
personalSubscription,
|
||||
premiumFeaturesDiscoverability,
|
||||
postCheckoutRedirect,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user