Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion web-assets/auth0/dev-tenant/rules/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function (user, context, callback) {
handle = _.get(user, "nickname", null);
}
console.log("Fetch roles for email/handle: ", user.email, handle, provider);

global.AUTH0_CLAIM_NAMESPACE = "https://" + configuration.DOMAIN + "/";
try {
request.post({
Expand Down Expand Up @@ -47,6 +46,12 @@ function (user, context, callback) {
// TEMP
let tcsso = res.result.content.regSource || '';

// block wipro/topgear contractor user
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 <a href="mailto:ask.topgear@wipro.com"> ask.topgear@wipro.com </a> with the error message.Back to application ';
if (roles.indexOf(configuration.TOPGEAR_CONTRACTOR_ROLE) > -1) {
return callback(topgearBlockMessage, user, context);
}

context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'roles'] = roles;
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'userId'] = userId;
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'handle'] = handle;
Expand Down
6 changes: 6 additions & 0 deletions web-assets/auth0/prod-tenant/rules/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ function (user, context, callback) {
// TEMP
let tcsso = res.result.content.regSource || '';

// block wipro/topgear contractor user
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 <a href="mailto:ask.topgear@wipro.com"> ask.topgear@wipro.com </a> with the error message.Back to application ';
if (roles.indexOf(configuration.TOPGEAR_CONTRACTOR_ROLE) > -1) {
return callback(topgearBlockMessage, user, context);
}

context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'roles'] = roles;
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'userId'] = userId;
context.idToken[global.AUTH0_CLAIM_NAMESPACE + 'handle'] = handle;
Expand Down
6 changes: 3 additions & 3 deletions web-assets/js/setupAuth0WithRedirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,9 @@ const authSetup = function () {
function showLoginError(message, linkUrl) {
try {
document.getElementById("page-title-heading").innerText = "Alert";
var messageElement = document.createElement("span");
messageElement.appendChild(document.createTextNode(message));
document.getElementById("loading_message_p").innerHTML = messageElement.innerText + " <a href=" + linkUrl + ">click here</a>";
var messageElement = document.createElement("textarea");
messageElement.innerHTML = message;
document.getElementById("loading_message_p").innerHTML = messageElement.value + " <a href=" + linkUrl + ">click here</a>";
} catch (err) {
logger("Error in changing loading message: ", err.message)
}
Expand Down