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

Commit a84ddb0

Browse files
author
vikasrohit
committed
AS#100297043256582, Move all login to link of Members to accounts.topcoder.com
-- Fixed jwt token service to return the token
1 parent 25c2714 commit a84ddb0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/services/jwtInterceptor.service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
6262
config.url.indexOf('badges') > -1) {
6363
token = AuthTokenService.getV2Token()
6464
} else {
65-
token = getCurrentUser() != null ? getCurrentUser().token : null
65+
token = getCurrentUser() !== null ? getCurrentUser().token : null
6666
}
67-
_checkAndRefreshToken(config, token)
67+
token = _checkAndRefreshToken(config, token)
6868
}
6969
// else
7070
logger.debug(String.supplant('Skipping authToken for "{url}, UnAuthenticated user"', config))
@@ -73,7 +73,7 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
7373
}
7474

7575
// for everything else assume that we need to send token
76-
var idToken = config.url.indexOf('v2/') > -1 ? AuthTokenService.getV2Token() : (getCurrentUser() != null ? getCurrentUser().token : null)
76+
var idToken = config.url.indexOf('v2/') > -1 ? AuthTokenService.getV2Token() : (getCurrentUser() !== null ? getCurrentUser().token : null)
7777

7878
if (!TcAuthService.isAuthenticated() || idToken == null) {
7979
var retUrl = CONSTANTS.MAIN_URL + '/?next=' + config.url
@@ -82,7 +82,7 @@ import { isTokenExpired, getFreshToken } from 'tc-accounts'
8282
}
8383

8484
// Note only v3tokens expire
85-
_checkAndRefreshToken(config, idToken)
85+
return _checkAndRefreshToken(config, idToken)
8686
}
8787
return service
8888
}

0 commit comments

Comments
 (0)