1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

Logging around api logout

This commit is contained in:
Kyle Spearrin
2017-03-15 19:26:16 -04:00
parent ec29cd3f6b
commit 123fe19ee3
2 changed files with 4 additions and 2 deletions

View File

@@ -324,7 +324,9 @@ function initApiService() {
// Helpers
function handleError(errorCallback, jqXHR, tokenError, self) {
if ((tokenError && jqXHR.status === 400) || jqXHR.status === 401 || jqXHR.status === 403) {
if (jqXHR && (tokenError && jqXHR.status === 400) || jqXHR.status === 401 || jqXHR.status === 403) {
console.log('Logging out from apiService at ' + new Date() + '. Reason: Status ' + jqXHR.status + '.');
console.log(jqXHR);
if (self && self.logoutCallback) {
self.logoutCallback(true, function () { })
}