Skip to content

Commit

Permalink
Merge pull request #179 from OpenConext/bugfix/authentication-excepti…
Browse files Browse the repository at this point in the history
…on-controller

Fix exception controller authentication exceptions
  • Loading branch information
Eric Pinxteren authored Jan 23, 2020
2 parents 82b174b + abb1eb7 commit 899924d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Exception;
use Surfnet\StepupBundle\Controller\ExceptionController as BaseExceptionController;
use Surfnet\StepupSelfService\SelfServiceBundle\Exception\MissingRequiredAttributeException;
use Symfony\Component\HttpKernel\Exception\HttpException;

final class ExceptionController extends BaseExceptionController
{
Expand All @@ -32,9 +33,11 @@ protected function getPageTitleAndDescription(Exception $exception)
{
$translator = $this->getTranslator();

if ($exception instanceof MissingRequiredAttributeException) {
$title = $translator->trans('stepup.error.missing_required_attribute.title');
$description = $exception->getMessage();
if ($exception instanceof HttpException) {
if ($exception instanceof MissingRequiredAttributeException) {
$title = $translator->trans('stepup.error.missing_required_attribute.title');
$description = $exception->getMessage();
}
}

if (isset($title) && isset($description)) {
Expand Down

0 comments on commit 899924d

Please sign in to comment.