Split the flows for less code intendation
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
bdb40a2d11
commit
ab641685ed
|
|
@ -137,20 +137,20 @@ class RegisterController extends Controller {
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$this->mailService->sendTokenByMail($registration);
|
|
||||||
} catch (RegistrationException $e) {
|
|
||||||
return $this->showEmailForm($email, $e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return new RedirectResponse(
|
|
||||||
$this->urlGenerator->linkToRoute(
|
|
||||||
'registration.register.showVerificationForm',
|
|
||||||
['secret' => $registration->getClientSecret()]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$this->mailService->sendTokenByMail($registration);
|
||||||
|
} catch (RegistrationException $e) {
|
||||||
|
return $this->showEmailForm($email, $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new RedirectResponse(
|
||||||
|
$this->urlGenerator->linkToRoute(
|
||||||
|
'registration.register.showVerificationForm',
|
||||||
|
['secret' => $registration->getClientSecret()]
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue