Skip to content

Commit

Permalink
[Workspace] only registers users at login if no ws role
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Jan 21, 2021
1 parent addb500 commit 502d8f3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,12 @@ public function selfRegisterAction(Workspace $workspace, User $currentUser): Jso
throw new AccessDeniedException();
}

if (!$workspace->getRegistrationValidation()) {
$this->workspaceManager->addUser($workspace, $currentUser);
} elseif (!$this->workspaceManager->isUserInValidationQueue($workspace, $currentUser)) {
$this->workspaceManager->addUserQueue($workspace, $currentUser);
if (!$this->workspaceManager->isRegistered($workspace, $currentUser)) {
if (!$workspace->getRegistrationValidation()) {
$this->workspaceManager->addUser($workspace, $currentUser);
} elseif (!$this->workspaceManager->isUserInValidationQueue($workspace, $currentUser)) {
$this->workspaceManager->addUserQueue($workspace, $currentUser);
}
}

return new JsonResponse(null, 204);
Expand Down

0 comments on commit 502d8f3

Please # to comment.