This commit is contained in:
Pellaeon Lin 2017-09-17 15:31:31 +08:00
parent 451bad1269
commit 706eda7b30
1 changed files with 2 additions and 5 deletions

View File

@ -135,7 +135,7 @@ class RegisterController extends Controller {
$registration = $this->registrationService->getRegistrationForToken($token); $registration = $this->registrationService->getRegistrationForToken($token);
try { try {
$this->registrationService->createAccount($registration, $username, $password); $user = $this->registrationService->createAccount($registration, $username, $password);
} catch (RegistrationException $exception) { } catch (RegistrationException $exception) {
return $this->renderError($exception->getMessage(), $exception->getHint()); return $this->renderError($exception->getMessage(), $exception->getHint());
} catch (\InvalidArgumentException $exception) { } catch (\InvalidArgumentException $exception) {
@ -149,10 +149,7 @@ class RegisterController extends Controller {
], 'guest'); ], 'guest');
} }
return new TemplateResponse('registration', 'message', return $this->registrationService->loginUser($user->getUID(), $username, $password, false);
['msg' => $this->l10n->t('Your account has been successfully created, you can <a href="%s">log in now</a>.', [$this->urlgenerator->getAbsoluteURL('/')])],
'guest'
);
} }
private function renderError($error, $hint="") { private function renderError($error, $hint="") {