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:
Joas Schilling 2020-07-17 11:14:29 +02:00
parent f0aa35b580
commit 201f388dee
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 3 additions and 11 deletions

View File

@ -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);

View File

@ -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;
}