Skip to content
Snippets Groups Projects
Commit ea65db8f authored by Sonia Zorba's avatar Sonia Zorba
Browse files

SessionData bugfix

parent f3024b5b
Branches
No related tags found
No related merge requests found
...@@ -231,7 +231,7 @@ public class JWTWebServiceController { ...@@ -231,7 +231,7 @@ public class JWTWebServiceController {
response.setStatus(HttpServletResponse.SC_NO_CONTENT); response.setStatus(HttpServletResponse.SC_NO_CONTENT);
} }
@GetMapping(value = {"/permission/{group:.+}", "/permission/"}, produces = MediaType.TEXT_PLAIN_VALUE) @GetMapping(value = {"/permission/{group:.+}", "/permission"}, produces = MediaType.TEXT_PLAIN_VALUE)
public void getUserPermission(@PathVariable("group") Optional<String> groupNames, @RequestParam("user_id") Optional<String> userId, HttpServletRequest request, HttpServletResponse response) throws IOException { public void getUserPermission(@PathVariable("group") Optional<String> groupNames, @RequestParam("user_id") Optional<String> userId, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (userId.isPresent()) { if (userId.isPresent()) {
......
...@@ -103,7 +103,7 @@ public class RapClient { ...@@ -103,7 +103,7 @@ public class RapClient {
try { try {
return function.apply(getEntity(body)); return function.apply(getEntity(body));
} catch (HttpClientErrorException.Unauthorized ex) { } catch (HttpClientErrorException.Unauthorized ex) {
if (sessionData == null) { if (request.getSession(false) == null) {
// we can't refresh the token without a session // we can't refresh the token without a session
throw ex; throw ex;
} }
...@@ -116,7 +116,7 @@ public class RapClient { ...@@ -116,7 +116,7 @@ public class RapClient {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
if (sessionData != null) { if (request.getSession(false) != null) {
headers.add("Authorization", "Bearer " + sessionData.getAccessToken()); headers.add("Authorization", "Bearer " + sessionData.getAccessToken());
} else { } else {
// from JWT web service // from JWT web service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment