public function handle(Request $request)
{
try {
$token = array_get($request->getQueryParams(), 'token');
$user = $this->bus->dispatch(new ConfirmEmail($token));
} catch (InvalidConfirmationTokenException $e) {
return new HtmlResponse('Invalid confirmation token');
}
$session = $request->getAttribute('session');
$this->authenticator->logIn($session, $user->id);
return new RedirectResponse($this->app->url());
}