|
3 | 3 | */
|
4 | 4 | package com.topcoder.direct.services.view.action;
|
5 | 5 |
|
| 6 | +import com.topcoder.direct.services.configs.ServerConfiguration; |
6 | 7 | import com.topcoder.direct.services.view.dto.contest.ContestStatus;
|
7 | 8 | import com.topcoder.direct.services.view.dto.project.ProjectBriefDTO;
|
8 | 9 | import com.topcoder.direct.services.view.util.DataProvider;
|
9 | 10 | import com.topcoder.direct.services.view.util.DirectUtils;
|
10 |
| -import com.topcoder.direct.services.view.util.JwtTokenUpdater; |
11 | 11 | import com.topcoder.security.TCSubject;
|
12 | 12 | import org.apache.http.HttpEntity;
|
13 | 13 | import org.apache.http.HttpHeaders;
|
|
17 | 17 | import org.apache.http.client.utils.URIBuilder;
|
18 | 18 | import org.apache.http.impl.client.DefaultHttpClient;
|
19 | 19 | import org.apache.log4j.Logger;
|
| 20 | +import org.apache.struts2.ServletActionContext; |
20 | 21 | import org.codehaus.jackson.JsonNode;
|
21 | 22 | import org.codehaus.jackson.map.DeserializationConfig;
|
22 | 23 | import org.codehaus.jackson.map.ObjectMapper;
|
@@ -215,11 +216,6 @@ public abstract class ServiceBackendDataTablesAction extends AbstractAction {
|
215 | 216 | */
|
216 | 217 | protected static final ObjectMapper objectMapper;
|
217 | 218 |
|
218 |
| - /** |
219 |
| - * JwtTokenUpdater |
220 |
| - */ |
221 |
| - private JwtTokenUpdater jwtTokenUpdater; |
222 |
| - |
223 | 219 | /**
|
224 | 220 | * <p>A static <code>Map</code> mapping the existing contest statuses to their textual presentations.</p>
|
225 | 221 | *
|
@@ -323,7 +319,8 @@ protected JsonNode getJsonResultFromAPI(URI apiEndPoint) throws Exception {
|
323 | 319 | // specify the get request
|
324 | 320 | HttpGet getRequest = new HttpGet(apiEndPoint);
|
325 | 321 |
|
326 |
| - String token = jwtTokenUpdater.getV3Token(); |
| 322 | + String token = DirectUtils.getCookieFromRequest(ServletActionContext.getRequest(), |
| 323 | + ServerConfiguration.JWT_V3_COOKIE_KEY).getValue(); |
327 | 324 |
|
328 | 325 | getRequest.setHeader(HttpHeaders.AUTHORIZATION,
|
329 | 326 | "Bearer " + token);
|
@@ -702,12 +699,4 @@ public String getEndDateTo() {
|
702 | 699 | public void setEndDateTo(String endDateTo) {
|
703 | 700 | this.endDateTo = endDateTo;
|
704 | 701 | }
|
705 |
| - |
706 |
| - public JwtTokenUpdater getJwtTokenUpdater() { |
707 |
| - return jwtTokenUpdater; |
708 |
| - } |
709 |
| - |
710 |
| - public void setJwtTokenUpdater(JwtTokenUpdater jwtTokenUpdater) { |
711 |
| - this.jwtTokenUpdater = jwtTokenUpdater; |
712 |
| - } |
713 | 702 | }
|
0 commit comments