Created
December 20, 2012 21:30
-
-
Save craigmarvelley/4348746 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(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