diff --git a/framework/core/src/Forum/Controller/ConfirmEmailController.php b/framework/core/src/Forum/Controller/ConfirmEmailController.php index d428d448c..f8bfe9083 100644 --- a/framework/core/src/Forum/Controller/ConfirmEmailController.php +++ b/framework/core/src/Forum/Controller/ConfirmEmailController.php @@ -9,8 +9,8 @@ namespace Flarum\Forum\Controller; -use Flarum\Foundation\Application; use Flarum\Http\SessionAuthenticator; +use Flarum\Http\UrlGenerator; use Flarum\User\Command\ConfirmEmail; use Illuminate\Contracts\Bus\Dispatcher; use Illuminate\Support\Arr; @@ -27,9 +27,9 @@ class ConfirmEmailController implements RequestHandlerInterface protected $bus; /** - * @var Application + * @var UrlGenerator */ - protected $app; + protected $url; /** * @var SessionAuthenticator @@ -38,13 +38,13 @@ class ConfirmEmailController implements RequestHandlerInterface /** * @param Dispatcher $bus - * @param Application $app + * @param UrlGenerator $url * @param SessionAuthenticator $authenticator */ - public function __construct(Dispatcher $bus, Application $app, SessionAuthenticator $authenticator) + public function __construct(Dispatcher $bus, UrlGenerator $url, SessionAuthenticator $authenticator) { $this->bus = $bus; - $this->app = $app; + $this->url = $url; $this->authenticator = $authenticator; } @@ -63,6 +63,6 @@ class ConfirmEmailController implements RequestHandlerInterface $session = $request->getAttribute('session'); $this->authenticator->logIn($session, $user->id); - return new RedirectResponse($this->app->url()); + return new RedirectResponse($this->url->to('forum')->base()); } } diff --git a/framework/core/src/Forum/Controller/LogOutController.php b/framework/core/src/Forum/Controller/LogOutController.php index bda19d153..be1b1fe40 100644 --- a/framework/core/src/Forum/Controller/LogOutController.php +++ b/framework/core/src/Forum/Controller/LogOutController.php @@ -9,7 +9,6 @@ namespace Flarum\Forum\Controller; -use Flarum\Foundation\Application; use Flarum\Http\Exception\TokenMismatchException; use Flarum\Http\Rememberer; use Flarum\Http\SessionAuthenticator; @@ -29,11 +28,6 @@ class LogOutController implements RequestHandlerInterface { use AssertPermissionTrait; - /** - * @var Application - */ - protected $app; - /** * @var Dispatcher */ @@ -60,7 +54,6 @@ class LogOutController implements RequestHandlerInterface protected $url; /** - * @param Application $app * @param Dispatcher $events * @param SessionAuthenticator $authenticator * @param Rememberer $rememberer @@ -68,14 +61,12 @@ class LogOutController implements RequestHandlerInterface * @param UrlGenerator $url */ public function __construct( - Application $app, Dispatcher $events, SessionAuthenticator $authenticator, Rememberer $rememberer, Factory $view, UrlGenerator $url ) { - $this->app = $app; $this->events = $events; $this->authenticator = $authenticator; $this->rememberer = $rememberer; @@ -93,7 +84,7 @@ class LogOutController implements RequestHandlerInterface $session = $request->getAttribute('session'); $actor = $request->getAttribute('actor'); - $url = Arr::get($request->getQueryParams(), 'return', $this->app->url()); + $url = Arr::get($request->getQueryParams(), 'return', $this->url->to('forum')->base()); // If there is no user logged in, return to the index. if ($actor->isGuest()) {