Form also uses ClientSecret now, so manually remove the registration at the end of the form too
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
f0aa35b580
commit
201f388dee
|
|
@ -227,6 +227,9 @@ class RegisterController extends Controller {
|
|||
return $this->showUserForm($secret, $token, $username, $exception->getMessage());
|
||||
}
|
||||
|
||||
// Delete registration
|
||||
$this->registrationService->deleteRegistration($registration);
|
||||
|
||||
if ($user->isEnabled()) {
|
||||
$this->registrationService->loginUser($user->getUID(), $user->getUID(), $password);
|
||||
|
||||
|
|
|
|||
|
|
@ -322,17 +322,6 @@ class RegistrationService {
|
|||
$user->setEnabled(false);
|
||||
}
|
||||
|
||||
// Delete pending registration if no client secret is stored
|
||||
// with client secret implies registered via API
|
||||
// without client secret implies registered via form
|
||||
// if registered via API, the registration request will be deleted in apicontroller::status
|
||||
if ($registration->getClientSecret() === null) {
|
||||
$res = $this->registrationMapper->delete($registration);
|
||||
if ($res === false) {
|
||||
throw new RegistrationException($this->l10n->t('Failed to delete pending registration request'));
|
||||
}
|
||||
}
|
||||
|
||||
$this->mailService->notifyAdmins($userId, $user->isEnabled(), $groupId);
|
||||
return $user;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue