mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
user is logged in after registration
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
v 2.0.2
|
v 2.0.2
|
||||||
- fix login on firefox when fields are autofilled by the browser
|
- 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
|
- fix link to documentation on home page and about page
|
||||||
- fields autocomplete is disabled on the profile page
|
- fields autocomplete is disabled on the profile page
|
||||||
- users are able to delete their account again
|
- users are able to delete their account again
|
||||||
|
|||||||
@@ -220,9 +220,10 @@ public class UserREST {
|
|||||||
@POST
|
@POST
|
||||||
@UnitOfWork
|
@UnitOfWork
|
||||||
@ApiOperation(value = "Register a new account")
|
@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 {
|
try {
|
||||||
userService.register(req.getName(), req.getPassword(), req.getEmail(), Arrays.asList(Role.USER));
|
userService.register(req.getName(), req.getPassword(), req.getEmail(), Arrays.asList(Role.USER));
|
||||||
|
userService.login(req.getName(), req.getPassword(), session);
|
||||||
return Response.ok().build();
|
return Response.ok().build();
|
||||||
} catch (final IllegalArgumentException e) {
|
} catch (final IllegalArgumentException e) {
|
||||||
return Response.status(422).entity(new ValidationErrorMessage(Collections.<ConstraintViolation<?>> emptySet()) {
|
return Response.status(422).entity(new ValidationErrorMessage(Collections.<ConstraintViolation<?>> emptySet()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user