Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fb8e6e9

Browse files
author
vikasrohit
committedMay 26, 2016
AS#100297043256582, Move all login to link of Members to accounts.topcoder.com
-- Reduced debug statements
1 parent d51e934 commit fb8e6e9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed
 

‎app/services/jwtInterceptor.service.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,24 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
1616
////////////
1717

1818
function _checkAndRefreshToken(config, token) {
19-
logger.debug('_checkAndRefreshToken: ' + config.url + ', ' + + token)
19+
// logger.debug('_checkAndRefreshToken: ' + config.url + ', ' + + token)
2020
if (isTokenExpired(token)) {
2121
logger.debug(String.supplant('Token has expired, attempting to refreshToken() for "{url}"', config))
2222

2323
return getFreshToken().then(function(refreshedToken) {
24-
logger.debug('Successfully refreshed V3 token.')
24+
// logger.debug('Successfully refreshed V3 token.')
2525
return refreshedToken
2626
})
2727
.catch(function(err) {
2828
// Server will not or cannot refresh token
2929
logger.debug('Unable to refresh V3 token, redirecting to login')
30-
// logger.debug(resp)
3130
var retUrl = CONSTANTS.MAIN_URL + '/?next=' + config.url
3231
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(retUrl)
3332

3433
return null
3534
})
3635
} else {
37-
logger.debug('returning token ' + token)
36+
// logger.debug('returning token ' + token)
3837
return token
3938
}
4039
}
@@ -56,11 +55,11 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
5655
for (var i = 0; i < haveItAddItEndpoints.length; i++) {
5756
var obj = haveItAddItEndpoints[i]
5857
var re = new RegExp(obj.url)
59-
logger.debug('haveItAddItEndpoints[' + i + ']=' + obj.url + ' ===> config.url=' + config.url)
58+
// logger.debug('haveItAddItEndpoints[' + i + ']=' + obj.url + ' ===> config.url=' + config.url)
6059
if (config.method.toUpperCase() === obj.method && re.test(config.url)) {
61-
logger.debug('checking for authentication')
60+
// logger.debug('checking for authentication')
6261
if (TcAuthService.isAuthenticated()) {
63-
logger.debug('found authenticated')
62+
// logger.debug('found authenticated')
6463
var token = null
6564
if (config.url.indexOf('v2/') > -1 ||
6665
config.url.indexOf('memberCert') > -1 ||
@@ -69,7 +68,7 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
6968
} else {
7069
token = getCurrentUser() !== null ? getCurrentUser().token : null
7170
}
72-
logger.debug('found token: ' + token)
71+
// logger.debug('found token: ' + token)
7372
return _checkAndRefreshToken(config, token)
7473
}
7574
// else
@@ -81,9 +80,9 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
8180
// for everything else assume that we need to send token
8281
var idToken = config.url.indexOf('v2/') > -1 ? AuthTokenService.getV2Token() : (getCurrentUser() !== null ? getCurrentUser().token : null)
8382

84-
logger.debug('idToken: ' + idToken)
83+
// logger.debug('idToken: ' + idToken)
8584
if (!TcAuthService.isAuthenticated() || idToken == null) {
86-
logger.debug('redirecting to accounts app')
85+
// logger.debug('redirecting to accounts app')
8786
var retUrl = CONSTANTS.MAIN_URL + '/?next=' + config.url
8887
$window.location = CONSTANTS.ACCOUNTS_APP_URL + '?retUrl=' + encodeURIComponent(retUrl)
8988
return

0 commit comments

Comments
 (0)
This repository has been archived.