@POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) {
        try{
            Credentials toSave = authServerLogic.userSignUp(credentials);

            context.setSecurityContext(new UserContext(context.getUriInfo(),toSave));

            logger.info("SignUp Successful. Returning: " + toSave);
            return ok(toSave);
        } catch (ServerDAO.DAOException e) {
            logger.severe(ExceptionUtils.getStackTrace(e));
            return fromDAOExpection(e);
        } catch (Exception e) {
            logger.severe(ExceptionUtils.getStackTrace(e));
            return Response.serverError().build();
        }
    }
@ POST @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response userSignUp ( @ Context ContainerRequestContext context , Credentials credentials ) { try { Credentials toSave = authServerLogic . userSignUp ( credentials ) ; context . setSecurityContext ( new UserContext ( context . getUriInfo ( ) , toSave ) ) ; logger . info ( "SignUp Successful. Returning: " + toSave ) ; return ok ( toSave ) ; } catch ( ServerDAO . DAOException e ) { logger . severe ( ExceptionUtils . getStackTrace ( e ) ) ; return fromDAOExpection ( e ) ; } catch ( Exception e ) { logger . severe ( ExceptionUtils . getStackTrace ( e ) ) ; return Response . serverError ( ) . build ( ) ; } }
/*
Saves user credentials