8000 [Cookbook][Security] don't output message from AuthenticationException by xabbuh · Pull Request #4761 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Cookbook][Security] don't output message from AuthenticationException #4761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cookbook/security/form_login_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ First, enable form login under your firewall:
# app/config/security.yml
security:
# ...

firewalls:
default:
anonymous: ~
Expand Down Expand Up @@ -98,7 +98,7 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
.. configuration-block::

.. code-block:: php-annotations

// src/AppBundle/Controller/SecurityController.php
// ...
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
Expand Down Expand Up @@ -165,7 +165,7 @@ form::

// src/AppBundle/Controller/SecurityController.php
// ...

// ADD THIS use STATEMENT above your class
use Symfony\Component\Security\Core\SecurityContextInterface;

Expand All @@ -182,7 +182,7 @@ form::
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
} else {
$error = '';
$error = null;
}

// last username entered by the user
Expand Down Expand Up @@ -218,7 +218,7 @@ Finally, create the template:
{# ... you will probably extends your base template, like base.html.twig #}

{% if error %}
<div>{{ error.message }}</div>
<div>{{ error.messageKey|trans(error.messageData) }}</div>
{% endif %}

<form action="{{ path('login_check') }}" method="post">
Expand Down Expand Up @@ -471,4 +471,4 @@ any firewall. This means you can't check for security or even access the
user object on these pages. See :doc:`/cookbook/controller/error_pages`
for more details.

.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle
.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle
0