This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,10 @@ const frontendConfigs = {
109109 "JWT_V2_NAME" :"tcjwt" ,
110110 "COOKIES_SECURE" :false ,
111111 "TC_LOGIN_URL" : "https://accounts.topcoder-dev.com/member" ,
112+
113+ // TODO: we can clean this conf, as no need https://github.com/topcoder-platform/topcoder-x-ui/issues/342
112114 "TC_USER_PROFILE_URL" : "https://api.topcoder-dev.com/v2/user/profile" ,
115+
113116 "API_URL" : "https://api.topcoder-dev.com" ,
114117 "ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2" ,
115118 "ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-dev.com/connector.html" ,
@@ -173,4 +176,4 @@ module.exports.frontendConfigs = {
173176 TOPCODER_URL : process . env . TOPCODER_URL || frontendConfigs [ activeEnv ] . TOPCODER_URL ,
174177 GITHUB_TEAM_URL : process . env . GITHUB_TEAM_URL || frontendConfigs [ activeEnv ] . GITHUB_TEAM_URL ,
175178 GITLAB_GROUP_URL : process . env . GITLAB_GROUP_URL || frontendConfigs [ activeEnv ] . GITLAB_GROUP_URL
176- } ;
179+ } ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const config = require('../config');
1515const errors = require ( '../common/errors' ) ;
1616const helper = require ( '../common/helper' ) ;
1717const UserMapping = require ( '../models' ) . UserMapping ;
18+ const decodeToken = require ( '@topcoder-platform/tc-auth-lib' ) . decodeToken ;
1819
1920const request = superagentPromise ( superagent , Promise ) ;
2021
@@ -25,13 +26,16 @@ const request = superagentPromise(superagent, Promise);
2526 * @returns {String } the handle
2627 */
2728async function getHandle ( token ) {
28- const handle = await request
29+ //issue - https://github.com/topcoder-platform/topcoder-x-ui/issues/342
30+
31+ /* const handle = await request
2932 .get(config.TOPCODER_VALUES[config.TOPCODER_ENV].TC_USER_PROFILE_URL)
3033 .set('Authorization', `Bearer ${token}`)
3134 .end()
3235 .then((res) => res.body.handle);
33-
34- return handle ;
36+ */
37+ const decoded = decodeToken ( token ) ;
38+ return decoded . handle ;
3539}
3640
3741getHandle . schema = Joi . object ( ) . keys ( {
You can’t perform that action at this time.
0 commit comments