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

Check tcsso token when checking if user is authenticated #518

Merged
merged 1 commit into from
Nov 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/services/authtoken.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

function AuthTokenService(CONSTANTS, $cookies, $location, store, $http, $log, jwtHelper, $q) {
var v2TokenKey = 'tcjwt';
var v2TCSSOTokenKey = 'tcsso'
var v3TokenKey = 'appiriojwt';
// use this api url over CONSTANTS
var apiUrl = CONSTANTS.AUTH_API_URL || CONSTANTS.API_URL;
Expand All @@ -15,6 +16,7 @@
setV3Token: setV3Token,
getV2Token: getV2Token,
getV3Token: getV3Token,
getTCSSOToken: getTCSSOToken,
removeTokens: removeTokens,
refreshV3Token: refreshV3Token,
exchangeToken: exchangeToken,
Expand All @@ -37,6 +39,10 @@
return $cookies.get(v2TokenKey);
}

function getTCSSOToken() {
return $cookies.get(v2TCSSOTokenKey);
}

function removeTokens() {
// remove tokens
// need to provide domain when removing cookie
Expand Down
2 changes: 1 addition & 1 deletion app/services/tcAuth.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
}

function isAuthenticated() {
return !!AuthTokenService.getV3Token() && !!AuthTokenService.getV2Token();
return !!AuthTokenService.getV3Token() && !!AuthTokenService.getV2Token() && !!AuthTokenService.getTCSSOToken();
}

}
Expand Down