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

Commit dc7cb61

Browse files
committed
Merge pull request #606 from appirio-tech/feature/SUP-2663
Feature/sup 2663
2 parents 27bf3ca + 638e906 commit dc7cb61

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

app/services/tcAuth.service.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
angular.module('tc.services').factory('TcAuthService', TcAuthService);
55

6-
TcAuthService.$inject = ['CONSTANTS', 'auth', 'AuthTokenService', '$rootScope', '$q', '$log', '$timeout', 'UserService', 'Helpers', 'ApiService', 'store'];
6+
TcAuthService.$inject = ['CONSTANTS', 'auth', 'AuthTokenService', '$rootScope', '$q', '$log', '$timeout', 'UserService', 'Helpers', 'ApiService', 'store', '$http'];
77

8-
function TcAuthService(CONSTANTS, auth, AuthTokenService, $rootScope, $q, $log, $timeout, UserService, Helpers, ApiService, store) {
8+
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;
1112
var service = {
1213
login: login,
1314
socialLogin: socialLogin,
@@ -162,6 +163,18 @@
162163
}
163164

164165
function logout() {
166+
$http({
167+
url: apiUrl + '/authorizations/1',
168+
method: 'DELETE',
169+
headers: {
170+
'Authorization': "Bearer " + AuthTokenService.getV3Token()
171+
}
172+
}).then(function(res) {
173+
$log.log('logout successful');
174+
}).catch(function(resp) {
175+
$log.error('logout error');
176+
});
177+
165178
return $q(function(resolve, reject) {
166179
AuthTokenService.removeTokens();
167180
$rootScope.$broadcast(CONSTANTS.EVENT_USER_LOGGED_OUT);

0 commit comments

Comments
 (0)