mirror of
https://github.com/flarum/core.git
synced 2025-07-19 15:51:16 +02:00
Fix crash on reset password page
This commit is contained in:
@@ -16,6 +16,7 @@ use Flarum\Core\PasswordToken;
|
|||||||
use Flarum\Http\Controller\AbstractHtmlController;
|
use Flarum\Http\Controller\AbstractHtmlController;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class ResetPasswordController extends AbstractHtmlController
|
class ResetPasswordController extends AbstractHtmlController
|
||||||
{
|
{
|
||||||
@@ -24,12 +25,18 @@ class ResetPasswordController extends AbstractHtmlController
|
|||||||
*/
|
*/
|
||||||
protected $view;
|
protected $view;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TranslatorInterface
|
||||||
|
*/
|
||||||
|
protected $translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Factory $view
|
* @param Factory $view
|
||||||
*/
|
*/
|
||||||
public function __construct(Factory $view)
|
public function __construct(Factory $view, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->view = $view;
|
$this->view = $view;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,6 +55,7 @@ class ResetPasswordController extends AbstractHtmlController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->view->make('flarum::reset')
|
return $this->view->make('flarum::reset')
|
||||||
|
->with('translator', $this->translator)
|
||||||
->with('passwordToken', $token->id)
|
->with('passwordToken', $token->id)
|
||||||
->with('csrfToken', $request->getAttribute('session')->get('csrf_token'));
|
->with('csrfToken', $request->getAttribute('session')->get('csrf_token'));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user