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

Added refresh token check for each API call. refactored logout messaging from authService

This commit is contained in:
Kyle Spearrin
2017-01-19 00:21:20 -05:00
parent 0b63eb58ba
commit 0bd77352b0
8 changed files with 159 additions and 76 deletions

View File

@@ -39,30 +39,10 @@
return deferred.promise;
};
// TODO: Fix callback hell by moving to promises
_service.logOut = function (callback) {
userService.getUserId(function (userId) {
syncService.setLastSync(new Date(0), function () {
settingsService.clear(function () {
tokenService.clearToken(function () {
cryptoService.clearKey(function () {
cryptoService.clearKeyHash(function () {
userService.clearUserIdAndEmail(function () {
loginService.clear(userId, function () {
folderService.clear(userId, function () {
$rootScope.vaultLogins = null;
$rootScope.vaultFolders = null;
chrome.runtime.sendMessage({ command: 'loggedOut' });
callback();
});
});
});
});
});
});
});
});
});
$rootScope.vaultLogins = null;
$rootScope.vaultFolders = null;
callback();
};
return _service;