1

fix invite

Co-authored-by: Christoph <tobi@urpost.de>
This commit is contained in:
Christoph
2020-03-27 14:04:32 +01:00
parent ef00c42f6f
commit 9ccb7c77a2
2 changed files with 17 additions and 5 deletions

View File

@ -296,7 +296,11 @@ public class WebController {
public String postAcceptInvite(KeycloakAuthenticationToken token,
@RequestParam("id") String groupId) {
controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), UUID.fromString(groupId));
User user = new User(keyCloakService.createAccountFromPrincipal(token));
if (!validationService.checkIfUserInGroup(userService.getGroupById(UUID.fromString(groupId)), user)) {
controllerService.addUser(keyCloakService.createAccountFromPrincipal(token), UUID.fromString(groupId));
}
return "redirect:/gruppen2/";
}