welcome page

This commit is contained in:
Athou
2014-08-09 16:07:24 +02:00
parent 33b683d037
commit bbf04c4687
10 changed files with 139 additions and 13 deletions

View File

@@ -216,10 +216,10 @@ public class UserREST {
public Response login(@ApiParam(required = true) LoginRequest req, @Session HttpSession session) {
Optional<User> user = userService.login(req.getName(), req.getPassword());
if (user.isPresent()) {
session.setAttribute(CommaFeedApplication.SESSION_USER, user);
session.setAttribute(CommaFeedApplication.SESSION_USER, user.get());
return Response.ok().build();
} else {
return Response.status(Response.Status.UNAUTHORIZED).build();
return Response.status(Response.Status.UNAUTHORIZED).entity("wrong username or password").build();
}
}