Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joedawson's avatar

5.2 - Flash session on postLogin

Hello all,

In 5.1 (and previous 5.* versions) to add any further logic to the postLogin method I could simply dump the existing method into my AuthController and make any changes I wanted to make.

In 5.2, the postLogin method seems to have moved around a little.

How would I flash a message depending on a success or unsuccessful authentication?

Thanks!

0 likes
2 replies
jekinney's avatar
Level 47

Easiest way imo is copy paste the login method from the trait and add your flash. That is if your using the auth scaffolding.

joedawson's avatar

Nice one, cheers @jekinney wasn't sure if I was to override the individual methods for handling the response, handleUserWasAuthenticated and sendFailedLoginResponse. But changing the login one as you suggested was easiest.

1 like

Please or to participate in this conversation.