Skip to content

Commit d5e5a22

Browse files
author
sachin-maheshwari
authored
Merge pull request #289 from topcoder-platform/dev
JIRA-plat 346, 380, etc
2 parents 82588e3 + 2997b32 commit d5e5a22

File tree

5 files changed

+60
-41
lines changed

5 files changed

+60
-41
lines changed

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
function (user, context, callback) {
22
if (context.clientID === configuration.CLIENT_ACCOUNTS_LOGIN) {
33
console.log("rule:onboarding-checklist:enter");
4-
console.log("rule:onboarding-checklist:context.request", context.request);
5-
6-
if (context.redirect) {
4+
5+
if (context.redirect) {
76
console.log("rule:onboarding-checklist:exiting due to context being a redirect");
87
return callback(null, user, context);
98
}
@@ -22,16 +21,11 @@ function (user, context, callback) {
2221
return callback(null, user, context);
2322
}
2423

25-
let handle = _.get(user, "handle", null);
26-
const provider = _.get(user, "identities[0].provider", null);
27-
if (isSocial || (!handle && provider === "auth0")) {
28-
handle = _.get(user, "nickname", null);
29-
}
30-
31-
console.log("rule:onboarding-checklist: fetch onboarding_checklist for email/handle: ", user.email, handle, provider);
24+
const handle = context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'handle'];
25+
console.log("rule:onboarding-checklist: fetch onboarding_checklist for email/handle: ", user.email, handle);
3226

33-
// TODO: Properly fetch handle for social logins
34-
if (handle == null || isSocial) {
27+
if (handle == null) {
28+
console.log("rule:onboarding-checklist: exiting due to handle being null.");
3529
return callback(null, user, context);
3630
}
3731

@@ -112,7 +106,7 @@ function (user, context, callback) {
112106
if (data.length === 0) {
113107
// User doesn't have any traits with traitId onboarding_checklist and should be shown the onboarding wizard
114108
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'show_onboarding_wizard'] = true;
115-
console.log('rule:onboarding-checklist:Setting show_onboarding_wizard to true', user);
109+
console.log('rule:onboarding-checklist:Setting show_onboarding_wizard to true');
116110
return callback(null, user, context);
117111
}
118112

@@ -128,7 +122,7 @@ function (user, context, callback) {
128122
}
129123
}
130124

131-
const profileCompletedData = onboardingChecklistTrait.data[0].profile_completed;
125+
const profileCompletedData = onboardingChecklistTrait.data.length > 0 ? onboardingChecklistTrait.data[0].profile_completed : null;
132126

133127
if (profileCompletedData) {
134128
if (profileCompletedData.status === "completed") {
@@ -143,7 +137,7 @@ function (user, context, callback) {
143137
}
144138

145139
// All checks failed - indicating user newly registered and needs to be shown the onboarding wizard
146-
console.log('rule:onboarding-checklist: set show_onboarding_wizard', user);
140+
console.log('rule:onboarding-checklist: set show_onboarding_wizard');
147141
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'show_onboarding_wizard'] = true;
148142
return callback(null, user, context);
149143
} catch (e) {

web-assets/auth0/dev-tenant/universal-login.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@
2626
}
2727
</script>
2828

29+
<!-- Google Tag Manager -->
30+
<script>(function (w, d, s, l, i) {
31+
w[l] = w[l] || []; w[l].push({
32+
'gtm.start':
33+
new Date().getTime(), event: 'gtm.js'
34+
}); var f = d.getElementsByTagName(s)[0],
35+
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
36+
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
37+
})(window, document, 'script', 'dataLayer', 'GTM-MXXQHG8');</script>
38+
<!-- End Google Tag Manager -->
39+
2940
</head>
3041

3142
<body>
@@ -422,4 +433,4 @@
422433
</script>
423434
</body>
424435

425-
</html>
436+
</html>

web-assets/auth0/js/jquery-3.5.1.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web-assets/auth0/prod-tenant/universal-login.html

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
77
<title>Sign In with Topcoder</title>
8-
<link rel="shortcut icon" type="image/png" href="https://www.topcoder.com/favicon.ico"/>
8+
<link rel="shortcut icon" type="image/png" href="https://www.topcoder.com/favicon.ico" />
99
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
1010
<link rel="preconnect" href="https://fonts.gstatic.com">
1111
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
@@ -24,8 +24,17 @@
2424
}
2525
</script>
2626

27+
<!-- Google Tag Manager -->
28+
<script>(function (w, d, s, l, i) {
29+
w[l] = w[l] || []; w[l].push({
30+
'gtm.start':
31+
new Date().getTime(), event: 'gtm.js'
32+
}); var f = d.getElementsByTagName(s)[0],
33+
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
34+
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
35+
})(window, document, 'script', 'dataLayer', 'GTM-MXXQHG8');</script>
36+
<!-- End Google Tag Manager -->
2737
</head>
28-
2938
<body>
3039
<div id='wrapper-container' class='page-wrapper'>
3140
<div class='row'>
@@ -179,7 +188,7 @@
179188
socialButtonStyle: 'small'
180189
},
181190
tc_standard: {
182-
allowedConnections: ['TC-User-Database', 'github', 'google-oauth2', 'wipro-adfs', 'Verified-User-Database'],
191+
allowedConnections: ['TC-User-Database', 'github', 'google-oauth2', 'wipro-adfs', 'wipro-azuread', 'Verified-User-Database'],
183192
theme: {
184193
logo: 'https://i.imgur.com/IY6TVjY.png',
185194
primaryColor: '#137d60'
@@ -198,7 +207,7 @@
198207
}
199208
},
200209
aha: {
201-
allowedConnections: ['TC-User-Database', 'github', 'google-oauth2', 'wipro-adfs', 'Verified-User-Database'],
210+
allowedConnections: ['TC-User-Database', 'github', 'google-oauth2', 'wipro-adfs', 'wipro-azuread', 'Verified-User-Database'],
202211
theme: {
203212
logo: 'https://i.imgur.com/CEU3plH.png',
204213
primaryColor: '#07a8f2'
@@ -386,22 +395,22 @@
386395
updateSignUp(regSource);
387396
mediaQuery.addListener(updateSignUp);
388397
try {
389-
const firstNameDiv =
390-
document.getElementById("1-firstName").parentNode.parentNode;
391-
const lastNameDiv =
392-
document.getElementById("1-lastName").parentNode.parentNode;
393-
const emailDiv = document.getElementById("1-email").parentNode.parentNode;
394-
emailDiv.parentNode.insertBefore(firstNameDiv, emailDiv);
395-
emailDiv.parentNode.insertBefore(lastNameDiv, emailDiv);
396-
try {
397-
document.getElementsByName("password")[0].placeholder = "Create a Password";
398-
//document.getElementById("1-country").value = "Select your country (current location)";
399-
} catch (e) {
400-
console.log("Error occured in changing placeholder text", e);
401-
}
398+
const firstNameDiv =
399+
document.getElementById("1-firstName").parentNode.parentNode;
400+
const lastNameDiv =
401+
document.getElementById("1-lastName").parentNode.parentNode;
402+
const emailDiv = document.getElementById("1-email").parentNode.parentNode;
403+
emailDiv.parentNode.insertBefore(firstNameDiv, emailDiv);
404+
emailDiv.parentNode.insertBefore(lastNameDiv, emailDiv);
405+
try {
406+
document.getElementsByName("password")[0].placeholder = "Create a Password";
407+
//document.getElementById("1-country").value = "Select your country (current location)";
402408
} catch (e) {
403-
console.log("Error occured in form re-ordering", e);
409+
console.log("Error occured in changing placeholder text", e);
404410
}
411+
} catch (e) {
412+
console.log("Error occured in form re-ordering", e);
413+
}
405414
});
406415

407416
lock.show();
@@ -472,11 +481,15 @@
472481

473482
</script>
474483
<script>
475-
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="ti8hUmZ1P9BJ73vUVM3CEe0iJCuvzMCY";analytics.SNIPPET_VERSION="4.13.2";
476-
analytics.load("ti8hUmZ1P9BJ73vUVM3CEe0iJCuvzMCY");
477-
analytics.page();
478-
}}();
479-
</script>
484+
!function () {
485+
var analytics = window.analytics = window.analytics || []; if (!analytics.initialize) if (analytics.invoked) window.console && console.error && console.error("Segment snippet included twice."); else {
486+
analytics.invoked = !0; analytics.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on", "addSourceMiddleware", "addIntegrationMiddleware", "setAnonymousId", "addDestinationMiddleware"]; analytics.factory = function (e) { return function () { var t = Array.prototype.slice.call(arguments); t.unshift(e); analytics.push(t); return analytics } }; for (var e = 0; e < analytics.methods.length; e++) { var key = analytics.methods[e]; analytics[key] = analytics.factory(key) } analytics.load = function (key, e) { var t = document.createElement("script"); t.type = "text/javascript"; t.async = !0; t.src = "https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js"; var n = document.getElementsByTagName("script")[0]; n.parentNode.insertBefore(t, n); analytics._loadOptions = e }; analytics._writeKey = "ti8hUmZ1P9BJ73vUVM3CEe0iJCuvzMCY"; analytics.SNIPPET_VERSION = "4.13.2";
487+
analytics.load("ti8hUmZ1P9BJ73vUVM3CEe0iJCuvzMCY");
488+
analytics.page();
489+
}
490+
}();
491+
</script>
492+
480493
</body>
481494

482-
</html>
495+
</html>

web-assets/static-pages/signup.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/>
1313
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500&display=swap" rel="stylesheet">
1414
<link rel="stylesheet" href="./styles.css" />
15-
1615
<script src="https://tc-public-static-files.topcoder.com/topcoder-auth/js/jquery-3.5.1.min.js"></script>
1716
<script src="https://tc-public-static-files.topcoder.com/topcoder-auth/js/country.js"></script>
1817
<script type="text/javascript" src="signup.js"></script>

0 commit comments

Comments
 (0)