forked from Archives/Athou_commafeed
user is logged in after registration
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
v 2.0.2
|
||||
- fix login on firefox when fields are autofilled by the browser
|
||||
- user is now logged in after registration
|
||||
- fix link to documentation on home page and about page
|
||||
- fields autocomplete is disabled on the profile page
|
||||
- users are able to delete their account again
|
||||
|
||||
@@ -220,9 +220,10 @@ public class UserREST {
|
||||
@POST
|
||||
@UnitOfWork
|
||||
@ApiOperation(value = "Register a new account")
|
||||
public Response register(@Valid @ApiParam(required = true) RegistrationRequest req) {
|
||||
public Response register(@Valid @ApiParam(required = true) RegistrationRequest req, @Session HttpSession session) {
|
||||
try {
|
||||
userService.register(req.getName(), req.getPassword(), req.getEmail(), Arrays.asList(Role.USER));
|
||||
userService.login(req.getName(), req.getPassword(), session);
|
||||
return Response.ok().build();
|
||||
} catch (final IllegalArgumentException e) {
|
||||
return Response.status(422).entity(new ValidationErrorMessage(Collections.<ConstraintViolation<?>> emptySet()) {
|
||||
|
||||
Reference in New Issue
Block a user