From 2b701d5d749022c2c71e8ff0671ec6f360c48fb7 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 5 Oct 2016 17:03:01 +0200 Subject: [PATCH] [Fix] Fixed json object not marshalled in AuthenticationService --- .../strolch/rest/endpoint/AuthenticationService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/AuthenticationService.java b/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/AuthenticationService.java index d0d771bd7..1e8a78b39 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/AuthenticationService.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/endpoint/AuthenticationService.java @@ -170,20 +170,20 @@ public class AuthenticationService { } catch (InvalidCredentialsException e) { logger.error(e.getMessage(), e); loginResult.addProperty("msg", "Could not log in as the given credentials are invalid"); //$NON-NLS-1$ - return Response.status(Status.UNAUTHORIZED).entity(loginResult).build(); + return Response.status(Status.UNAUTHORIZED).entity(loginResult.toString()).build(); } catch (AccessDeniedException e) { logger.error(e.getMessage(), e); loginResult.addProperty("msg", MessageFormat.format("Could not log in due to: {0}", e.getMessage())); //$NON-NLS-1$ - return Response.status(Status.UNAUTHORIZED).entity(loginResult).build(); + return Response.status(Status.UNAUTHORIZED).entity(loginResult.toString()).build(); } catch (StrolchException | PrivilegeException e) { logger.error(e.getMessage(), e); loginResult.addProperty("msg", MessageFormat.format("Could not log in due to: {0}", e.getMessage())); //$NON-NLS-1$ - return Response.status(Status.FORBIDDEN).entity(loginResult).build(); + return Response.status(Status.FORBIDDEN).entity(loginResult.toString()).build(); } catch (Exception e) { logger.error(e.getMessage(), e); String msg = e.getMessage(); loginResult.addProperty("msg", MessageFormat.format("{0}: {1}", e.getClass().getName(), msg)); //$NON-NLS-1$ - return Response.serverError().entity(loginResult).build(); + return Response.serverError().entity(loginResult.toString()).build(); } } @@ -210,12 +210,12 @@ public class AuthenticationService { } catch (StrolchException | PrivilegeException e) { logger.error(e.getMessage(), e); logoutResult.addProperty("msg", MessageFormat.format("Could not logout due to: {0}", e.getMessage())); //$NON-NLS-1$ - return Response.status(Status.UNAUTHORIZED).entity(logoutResult).build(); + return Response.status(Status.UNAUTHORIZED).entity(logoutResult.toString()).build(); } catch (Exception e) { logger.error(e.getMessage(), e); String msg = e.getMessage(); logoutResult.addProperty("msg", MessageFormat.format("{0}: {1}", e.getClass().getName(), msg)); //$NON-NLS-1$ - return Response.serverError().entity(logoutResult).build(); + return Response.serverError().entity(logoutResult.toString()).build(); } }