Split the flows for less code intendation

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-11-17 19:57:14 +01:00
parent bdb40a2d11
commit ab641685ed
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 14 additions and 14 deletions

View File

@ -137,7 +137,8 @@ class RegisterController extends Controller {
] ]
) )
); );
} else { }
try { try {
$this->mailService->sendTokenByMail($registration); $this->mailService->sendTokenByMail($registration);
} catch (RegistrationException $e) { } catch (RegistrationException $e) {
@ -151,7 +152,6 @@ class RegisterController extends Controller {
) )
); );
} }
}
/** /**
* @NoCSRFRequired * @NoCSRFRequired

View File

@ -142,7 +142,7 @@ class RegistrationService {
$registration->setEmail($email); $registration->setEmail($email);
$registration->setUsername($username); $registration->setUsername($username);
$registration->setDisplayname($displayname); $registration->setDisplayname($displayname);
if ($password !== "") { if ($password !== '') {
$password = $this->crypto->encrypt($password); $password = $this->crypto->encrypt($password);
$registration->setPassword($password); $registration->setPassword($password);
} }