Commit 91d2b8ea by kevalbhatt

ATLAS-3629 : UI: skipDefaultError handler improvement (2 patch)

parent ec3c6dba
...@@ -63,6 +63,7 @@ module.exports = function(grunt) { ...@@ -63,6 +63,7 @@ module.exports = function(grunt) {
proxies: [{ proxies: [{
context: '/api', // the context of the data service context: '/api', // the context of the data service
host: '127.0.0.1', host: '127.0.0.1',
auth: "admin:admin",
port: 21000, // the port that the data service is running on port: 21000, // the port that the data service is running on
https: false https: false
}], }],
......
...@@ -884,7 +884,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -884,7 +884,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
CommonViewFunction.restCsrfCustomHeader = header; CommonViewFunction.restCsrfCustomHeader = header;
CommonViewFunction.restCsrfMethodsToIgnore = {}; CommonViewFunction.restCsrfMethodsToIgnore = {};
methods.map(function(method) { CommonViewFunction.restCsrfMethodsToIgnore[method] = true; }); methods.map(function(method) { CommonViewFunction.restCsrfMethodsToIgnore[method] = true; });
var statusCodeErrorFn = function(error) {
Utils.defaultErrorHandler(null, error)
}
Backbone.$.ajaxSetup({ Backbone.$.ajaxSetup({
statusCode: {
401: statusCodeErrorFn,
419: statusCodeErrorFn,
403: statusCodeErrorFn
},
beforeSend: CommonViewFunction.addRestCsrfCustomHeader beforeSend: CommonViewFunction.addRestCsrfCustomHeader
}); });
} }
......
...@@ -63,6 +63,7 @@ module.exports = function(grunt) { ...@@ -63,6 +63,7 @@ module.exports = function(grunt) {
proxies: [{ proxies: [{
context: '/api', // the context of the data service context: '/api', // the context of the data service
host: '127.0.0.1', host: '127.0.0.1',
auth: "admin:admin",
port: 21000, // the port that the data service is running on port: 21000, // the port that the data service is running on
https: false https: false
}], }],
......
...@@ -904,7 +904,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -904,7 +904,15 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
CommonViewFunction.restCsrfCustomHeader = header; CommonViewFunction.restCsrfCustomHeader = header;
CommonViewFunction.restCsrfMethodsToIgnore = {}; CommonViewFunction.restCsrfMethodsToIgnore = {};
methods.map(function(method) { CommonViewFunction.restCsrfMethodsToIgnore[method] = true; }); methods.map(function(method) { CommonViewFunction.restCsrfMethodsToIgnore[method] = true; });
var statusCodeErrorFn = function(error) {
Utils.defaultErrorHandler(null, error)
}
Backbone.$.ajaxSetup({ Backbone.$.ajaxSetup({
statusCode: {
401: statusCodeErrorFn,
419: statusCodeErrorFn,
403: statusCodeErrorFn
},
beforeSend: CommonViewFunction.addRestCsrfCustomHeader beforeSend: CommonViewFunction.addRestCsrfCustomHeader
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment