Skip to content

Instantly share code, notes, and snippets.

@craigmarvelley
Created December 20, 2012 21:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
$(document).ajaxError(function (e, xhr, settings, exception) {
var STATUS_CODE_UNAUTHORIZED = 401,
STATUS_CODE_FORBIDDEN = 403;
// If we don't have a valid session, show a login form
if (xhr.status === STATUS_CODE_UNAUTHORIZED || xhr.status === STATUS_CODE_FORBIDDEN) {
showLoginForm();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment