refactoring.

This commit is contained in:
EZZEDDINE.ELHAZATI 2019-07-23 16:13:48 +01:00
parent 4c6182d45f
commit ce9e956199
1 changed files with 5 additions and 3 deletions

View File

@ -47,9 +47,11 @@ public class RefreshTokenServlet extends AbstractServlet {
.header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret))
.post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), Response.class);
JsonObject tokenResponse = jaxrsResponse.readEntity(JsonObject.class);
System.out.println(tokenResponse);
request.getSession().setAttribute("tokenResponse", tokenResponse);
if (jaxrsResponse.getStatus() == 200) {
request.getSession().setAttribute("tokenResponse", tokenResponse);
} else {
request.setAttribute("error", tokenResponse.getString("error_description", "error!"));
}
dispatch("/", request, response);
}
}