On 09.12.2010, at 02:43, Dennis Jacobfeuerborn wrote:
> Hi,
> a few weeks ago I inquired about a problem with flash messages when
> using the security component but didn't get a response so now that PR4
> is out I want to try again.
> What I'm currently doing is I reserved a place in the layout to
> display error messages. These error messages are set using flash
> messages after an operation succeeds of fails.
> The problem is that after I added support for the security component
> and adding a login screen I tried setting a flash message when the
> login failed but this doesn't work as expected. I believe this
> behavior has something to do with the internal redirects the security
> component is making.
> Is this issue known or is there anything special that needs to be done
> to be able to use flashes together with such a login form?
Yeah I also noticed this.
The work around I found was the following:
if
($this->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR))
{
$error =
$this->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error =
$this->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
$this->get('request')->getSession()->remove(SecurityContext::AUTHENTICATION_ERROR);
}
Notice that when I get the error message out of the session I delete it right
after.
regards.
Lukas Kahwe Smith
[email protected]
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en