Lexikjwtauthenticationbundle: Can't manage to trigger AuthenticationSuccessListener

Created on 19 Nov 2016  路  3Comments  路  Source: lexik/LexikJWTAuthenticationBundle

Hi, using Symfony 2.8 with MongoDB I can't manage to trigger the listener, the response always stays the same (the token) when I do a POST through /login.

jwt2
jwt1
jwt3

The die() doesn't work.

Thanks for your help.

Most helpful comment

After hours of research... I finally found the problem, it was missing an UserInterface in the AuthenticationSucessListener (which is highlighted in the screen), the worst part of it is... it kept sending the token like no problem and there wasn't any error message about it !
jwt

All 3 comments

After hours of research... I finally found the problem, it was missing an UserInterface in the AuthenticationSucessListener (which is highlighted in the screen), the worst part of it is... it kept sending the token like no problem and there wasn't any error message about it !
jwt

it kept sending the token like no problem and there wasn't any error message about it !

Yeah, since you're calling return in your listener, the event lifecycle just continue and our AuthenticationSuccessHandler returns the original response containing the original data, as it is already set before your listener intercept the event.

Unfortunately, event listeners may be painful to debug...

Yeah, thanks to your sandbox and the listener in it I managed to find the problem =)

Was this page helpful?
0 / 5 - 0 ratings