Skip to content

Commit 514271a

Browse files
author
Sachin Maheshwari
committed
Plat-960, block sign-in for wipro contractor
1 parent cfe4931 commit 514271a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function (user, context, callback) {
1919
handle = _.get(user, "nickname", null);
2020
}
2121
console.log("Fetch roles for email/handle: ", user.email, handle, provider);
22-
2322
global.AUTH0_CLAIM_NAMESPACE = "https://" + configuration.DOMAIN + "/";
2423
try {
2524
request.post({
@@ -47,6 +46,12 @@ function (user, context, callback) {
4746
// TEMP
4847
let tcsso = res.result.content.regSource || '';
4948

49+
// block wipro/topgear contractor user
50+
const topgearBlockMessage = "Topgear can be accessed only by Wipro Employees. If you are a Wipro employee and not able to access, drop an email to ask.topgear@wipro.com with the error message";
51+
if (roles.indexOf(configuration.TOPGEAR_CONTRACTOR_ROLE) > -1) {
52+
return callback(topgearBlockMessage, user, context);
53+
}
54+
5055
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'roles'] = roles;
5156
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'userId'] = userId;
5257
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'handle'] = handle;

0 commit comments

Comments
 (0)