From 706eda7b30553e1e23f19c78f1d910c3b0a08700 Mon Sep 17 00:00:00 2001 From: Pellaeon Lin Date: Sun, 17 Sep 2017 15:31:31 +0800 Subject: [PATCH] Fix #91 --- controller/registercontroller.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/controller/registercontroller.php b/controller/registercontroller.php index e69e1c1..2112e3a 100644 --- a/controller/registercontroller.php +++ b/controller/registercontroller.php @@ -135,7 +135,7 @@ class RegisterController extends Controller { $registration = $this->registrationService->getRegistrationForToken($token); try { - $this->registrationService->createAccount($registration, $username, $password); + $user = $this->registrationService->createAccount($registration, $username, $password); } catch (RegistrationException $exception) { return $this->renderError($exception->getMessage(), $exception->getHint()); } catch (\InvalidArgumentException $exception) { @@ -149,10 +149,7 @@ class RegisterController extends Controller { ], 'guest'); } - return new TemplateResponse('registration', 'message', - ['msg' => $this->l10n->t('Your account has been successfully created, you can log in now.', [$this->urlgenerator->getAbsoluteURL('/')])], - 'guest' - ); + return $this->registrationService->loginUser($user->getUID(), $username, $password, false); } private function renderError($error, $hint="") {