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 = {
109
109
"JWT_V2_NAME" :"tcjwt" ,
110
110
"COOKIES_SECURE" :false ,
111
111
"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
112
114
"TC_USER_PROFILE_URL" : "https://api.topcoder-dev.com/v2/user/profile" ,
115
+
113
116
"API_URL" : "https://api.topcoder-dev.com" ,
114
117
"ADMIN_TOOL_URL" : "https://api.topcoder-dev.com/v2" ,
115
118
"ACCOUNTS_CONNECTOR_URL" : "https://accounts.topcoder-dev.com/connector.html" ,
@@ -173,4 +176,4 @@ module.exports.frontendConfigs = {
173
176
TOPCODER_URL : process . env . TOPCODER_URL || frontendConfigs [ activeEnv ] . TOPCODER_URL ,
174
177
GITHUB_TEAM_URL : process . env . GITHUB_TEAM_URL || frontendConfigs [ activeEnv ] . GITHUB_TEAM_URL ,
175
178
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');
15
15
const errors = require ( '../common/errors' ) ;
16
16
const helper = require ( '../common/helper' ) ;
17
17
const UserMapping = require ( '../models' ) . UserMapping ;
18
+ const decodeToken = require ( '@topcoder-platform/tc-auth-lib' ) . decodeToken ;
18
19
19
20
const request = superagentPromise ( superagent , Promise ) ;
20
21
@@ -25,13 +26,16 @@ const request = superagentPromise(superagent, Promise);
25
26
* @returns {String } the handle
26
27
*/
27
28
async 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
29
32
.get(config.TOPCODER_VALUES[config.TOPCODER_ENV].TC_USER_PROFILE_URL)
30
33
.set('Authorization', `Bearer ${token}`)
31
34
.end()
32
35
.then((res) => res.body.handle);
33
-
34
- return handle ;
36
+ */
37
+ const decoded = decodeToken ( token ) ;
38
+ return decoded . handle ;
35
39
}
36
40
37
41
getHandle . schema = Joi . object ( ) . keys ( {
You can’t perform that action at this time.
0 commit comments