Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 40f85d1

Browse files
committed
Merge branch 'feature/SUP-2663' into release/v1.0.18
2 parents b08222f + c9db757 commit 40f85d1

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

app/services/tcAuth.service.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
function TcAuthService(CONSTANTS, auth, AuthTokenService, $rootScope, $q, $log, $timeout, UserService, Helpers, ApiService, store, $http) {
99
$log = $log.getInstance("TcAuthServicetcAuth");
1010
var auth0 = auth;
11-
var apiUrl = CONSTANTS.API_URL_V3;
11+
var apiUrl = CONSTANTS.AUTH_API_URL;
1212
var service = {
1313
login: login,
1414
socialLogin: socialLogin,
@@ -163,22 +163,29 @@
163163
}
164164

165165
function logout() {
166-
$http({
166+
// options for DELETE http call
167+
var logoutOptions = {
167168
url: apiUrl + '/authorizations/1',
168169
method: 'DELETE',
169170
headers: {
170171
'Authorization': "Bearer " + AuthTokenService.getV3Token()
171172
}
172-
}).then(function(res) {
173-
$log.log('logout successful');
174-
}).catch(function(resp) {
175-
$log.error('logout error');
176-
});
173+
};
174+
177175

176+
// logout of all browsers
178177
return $q(function(resolve, reject) {
178+
// remove local token
179179
AuthTokenService.removeTokens();
180180
$rootScope.$broadcast(CONSTANTS.EVENT_USER_LOGGED_OUT);
181181
resolve();
182+
// $http(logoutOptions).then(function(res) {
183+
// $log.log('logout successful');
184+
// resolve();
185+
// }).catch(function(resp) {
186+
// $log.error('logout error');
187+
// reject();
188+
// });
182189
});
183190
}
184191

0 commit comments

Comments
 (0)