Skip to content
Snippets Groups Projects
Commit 1b27e93a authored by Tom Käsler's avatar Tom Käsler Committed by Daniel Gerhardt
Browse files

Return 403 Forbidden on duplicated username when registering

parent db357fd8
Branches
1 merge request!126Return 403 Forbidden on duplicated username when registering
Pipeline #26467 passed with warnings with stages
in 1 minute and 22 seconds
...@@ -94,7 +94,9 @@ public class UserController extends AbstractEntityController<UserProfile> { ...@@ -94,7 +94,9 @@ public class UserController extends AbstractEntityController<UserProfile> {
@PostMapping(REGISTER_MAPPING) @PostMapping(REGISTER_MAPPING)
public void register(@RequestBody LoginCredentials loginCredentials) { public void register(@RequestBody LoginCredentials loginCredentials) {
userService.create(loginCredentials.getLoginId(), loginCredentials.getPassword()); if (userService.create(loginCredentials.getLoginId(), loginCredentials.getPassword()) == null) {
throw new ForbiddenException();
}
} }
@RequestMapping(value = ACTIVATE_MAPPING, method = RequestMethod.POST) @RequestMapping(value = ACTIVATE_MAPPING, method = RequestMethod.POST)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment