Skip to content

Commit 2c3a968

Browse files
author
sachin-maheshwari
authored
Merge pull request #283 from rakibansary/fix/enterprise-login-exclusion
fix: exclude topgear users from onboarding flow
2 parents f9db7b0 + 50df93f commit 2c3a968

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,28 @@ function (user, context, callback) {
1111
const _ = require('lodash');
1212
const moment = require('moment');
1313

14+
const isSocial = _.get(user, "identities[0].isSocial");
15+
const connection = _.get(user, "identities[0].connection");
16+
17+
console.log("rule:onboarding-checklist: isSocial/connection", isSocial + "/" + connection);
18+
console.log("rule:onboarding-checklist: WIPRO_SS_AZURE_AD_CONNECTION_NAME", configuration.WIPRO_SSO_AZURE_AD_CONNECTION_NAME);
19+
20+
if (_.includes([configuration.WIPRO_SSO_AZURE_AD_CONNECTION_NAME], connection)) {
21+
console.log("rule:onboarding-checklist:exiting due to user being an enterprise user.");
22+
return callback(null, user, context);
23+
}
24+
1425
let handle = _.get(user, "handle", null);
1526
const provider = _.get(user, "identities[0].provider", null);
16-
if (!handle && provider === "auth0") {
27+
if (isSocial || (!handle && provider === "auth0")) {
1728
handle = _.get(user, "nickname", null);
1829
}
1930

31+
if (handle == null) {
32+
return callback();
33+
}
34+
35+
2036
console.log("rule:onboarding-checklist: fetch onboarding_checklist for email/handle: ", user.email, handle, provider);
2137

2238
const createdAt = _.get(user, "created_at", null);

0 commit comments

Comments
 (0)