Created
December 13, 2012 00:55
-
-
Save justhamade/4273113 to your computer and use it in GitHub Desktop.
AJAX cross domain auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({$ | |
xhrFields: {$ | |
withCredentials: true$ | |
},$ | |
crossDomain: true,$ | |
statusCode: {$ | |
401: function(){$ | |
// Redirec the to the login page.$ | |
console.log('401');$ | |
//window.location.replace('/web/#login');$ | |
},$ | |
403: function() {$ | |
// 403 -- Access denied$ | |
console.log('403');$ | |
//window.location.replace('/web/#denied');$ | |
}$ | |
}$ | |
});$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment