Skip to content

Commit

Permalink
Properly wrap error bag in session
Browse files Browse the repository at this point in the history
Second part of fixing #1683.
  • Loading branch information
franzliedke committed Feb 3, 2019
1 parent 4611abe commit ed43ad9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Forum/Controller/SavePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Flarum\User\UserValidator;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Validation\Factory;
use Illuminate\Support\MessageBag;
use Illuminate\Validation\ValidationException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
Expand Down Expand Up @@ -86,7 +87,7 @@ public function handle(Request $request): ResponseInterface
throw new ValidationException($validator);
}
} catch (ValidationException $e) {
$request->getAttribute('session')->put('errors', $e->errors());
$request->getAttribute('session')->put('errors', new MessageBag($e->errors()));

return new RedirectResponse($this->url->to('forum')->route('resetPassword', ['token' => $token->token]));
}
Expand Down

0 comments on commit ed43ad9

Please sign in to comment.