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

Commit d659fd5

Browse files
author
Sachin Maheshwari
committed
changing logout logic for new auth flow.
1 parent 94210e5 commit d659fd5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/front/src/app/auth/auth.service.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ angular.module('topcoderX')
1111
var GET_FRESH_TOKEN_SUCCESS = 'GET_FRESH_TOKEN_SUCCESS';
1212
var GET_FRESH_TOKEN_FAILURE = 'GET_FRESH_TOKEN_FAILURE';
1313

14-
var LOGOUT_REQUEST = 'LOGOUT_REQUEST';
15-
var LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
16-
var LOGOUT_FAILURE = 'LOGOUT_FAILURE';
14+
//var LOGOUT_REQUEST = 'LOGOUT_REQUEST';
15+
//var LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
16+
//var LOGOUT_FAILURE = 'LOGOUT_FAILURE';
1717

1818
// local variables
1919
var connectorIFrame, url, loading;
@@ -148,14 +148,14 @@ angular.module('topcoderX')
148148
AuthService.logout = function () {
149149
// send request to the server that we want to log out
150150
// save loggingOut promise to be accessed any time
151-
AuthService.logginOut = proxyCall(LOGOUT_REQUEST, LOGOUT_SUCCESS, LOGOUT_FAILURE).then(function () {
152-
AuthService.logginOut = null;
153-
// remove only token V3, which we set from the script manually
154-
// token V2 will be removed automatically during logout server request
155-
$cookies.remove($rootScope.appConfig.JWT_V3_NAME, { path: '/' });
156-
});
157-
158-
return AuthService.logginOut;
151+
//AuthService.logginOut = proxyCall(LOGOUT_REQUEST, LOGOUT_SUCCESS, LOGOUT_FAILURE).then(function () {
152+
//AuthService.logginOut = null;
153+
// remove only token V3, which we set from the script manually
154+
// token V2 will be removed automatically during logout server request
155+
//$cookies.remove($rootScope.appConfig.JWT_V3_NAME, { path: '/' });
156+
//});
157+
$window.location.href = $rootScope.appConfig.TC_LOGIN_URL + '?logout=true&retUrl=' + encodeURIComponent($window.location.href);
158+
//return AuthService.logginOut;
159159
}
160160

161161
AuthService.login = function () {

0 commit comments

Comments
 (0)