Commit ea65db8f authored by Sonia Zorba's avatar Sonia Zorba
Browse files

SessionData bugfix

parent f3024b5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ public class JWTWebServiceController {
        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 {

        if (userId.isPresent()) {
+2 −2
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ public class RapClient {
        try {
            return function.apply(getEntity(body));
        } catch (HttpClientErrorException.Unauthorized ex) {
            if (sessionData == null) {
            if (request.getSession(false) == null) {
                // we can't refresh the token without a session
                throw ex;
            }
@@ -116,7 +116,7 @@ public class RapClient {

        HttpHeaders headers = new HttpHeaders();
        headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
        if (sessionData != null) {
        if (request.getSession(false) != null) {
            headers.add("Authorization", "Bearer " + sessionData.getAccessToken());
        } else {
            // from JWT web service