Skip to content

Commit bc016b8

Browse files
committed
feat: redirect to return all after onboarding is completed
1 parent 17be8d2 commit bc016b8

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ workflows:
7171
only:
7272
- dev
7373
- hotfix/resendActivationEmail
74+
- feat/plat-320
7475

7576
# Production builds are exectuted only on tagged commits to the
7677
# master branch.

web-assets/auth0/dev-tenant/rules/onboardingChecklist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ function (user, context, callback) {
115115

116116
for (let checklistTrait of onboardingChecklistTrait.data) {
117117
if (checklistTrait.onboarding_wizard != null) {
118-
if ( /* checklistTrait.onboarding_wizard.status != null || */ // any valid status indicates user has already seen onboarding wizard and needn't be shown again.
118+
if ( checklistTrait.onboarding_wizard.status !== 'pending_at_user' || // any non pending_at_user status indicates OB was either seen or completed and can be skipped
119119
checklistTrait.onboarding_wizard.skip ||// for certain signup routes skip is set to true, and thus onboarding wizard needn't be shown
120120
checklistTrait.onboarding_wizard.override === 'skip')
121121
{
122122
return callback(null, user, context);
123-
} else if (checklistTrait.onboarding_wizard.override === 'retUrl') {
124-
override = 'retUrl';
123+
} else if (checklistTrait.onboarding_wizard.override === 'useRetUrl') {
124+
override = 'useRetUrl';
125125
}
126126
}
127127
}

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const authSetup = function () {
4747
let returnAppUrl = handleSpecificReturnUrl(qs['retUrl'], 'retUrl');
4848
let appUrl = qs['appUrl'] || false;
4949

50+
console.log('returnAppUrl', returnAppUrl);
51+
console.log('appUrl', appUrl);
52+
5053
if (utmSource &&
5154
(utmSource != 'undefined') &&
5255
(enterpriseCustomers.indexOf(utmSource) > -1)) {
@@ -272,7 +275,7 @@ const authSetup = function () {
272275
Object.keys(claims).forEach(key => {
273276
logger('Checking key', key);
274277
if (key.indexOf('onboarding_wizard') !== -1) {
275-
if (claims[key] === 'show' || claims[key] === 'override') {
278+
if (claims[key] === 'show' || claims[key] === 'useRetUrl') {
276279
showOnboardingWizard = claims[key];
277280
}
278281
}
@@ -315,9 +318,8 @@ const authSetup = function () {
315318

316319
if (showOnboardingWizard) {
317320
logger('Take user to onboarding wizard', showOnboardingWizard);
318-
if (showOnboardingWizard === 'retUrl') {
319-
logger('Need to persist appUrl', returnAppUrl)
320-
setCookie('returnAfterOnboard', returnAppUrl) // TODO: use localStorage instead?
321+
if (showOnboardingWizard === 'useRetUrl') {
322+
setCookie('returnAfterOnboard', qs['appUrl'] || qs['retUrl'])
321323
}
322324
redirectToOnboardingWizard(returnAppUrl);
323325
}

0 commit comments

Comments
 (0)