Skip to content
Snippets Groups Projects
Commit efb199bc authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Merge branch 'fix-200-on-second-user-register' into 'master'

Return 403 Forbidden on duplicated username when registering

Closes #38

See merge request !126
parents db357fd8 1b27e93a
Branches
1 merge request!126Return 403 Forbidden on duplicated username when registering
Pipeline #26468 passed with warnings with stages
in 1 minute and 52 seconds
......@@ -94,7 +94,9 @@ public class UserController extends AbstractEntityController<UserProfile> {
@PostMapping(REGISTER_MAPPING)
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)
......
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