Jwt-auth: Listening for Auth events

Created on 29 Oct 2016  Â·  10Comments  Â·  Source: tymondesigns/jwt-auth

How about event listening in JWT-Auth guard? I need to listen for attemp, auttenticated and others jwt auth events like this https://laravel.com/docs/5.3/authentication#events

Using jwt-auth package I can't listen for theses events. Help?

Most helpful comment

The solution I've come up with (I'm not a fan of doing it this way though) is fire the events in the auth controller on the different stages of auth (attempt, login success, logout). but jwt-auth really should fire events.

All 10 comments

I have same problem. can you find any solution ?

The solution I've come up with (I'm not a fan of doing it this way though) is fire the events in the auth controller on the different stages of auth (attempt, login success, logout). but jwt-auth really should fire events.

Any official JWT Event? still need a built in solution

+++

Same here. I was just looking at setting up authentication logging but putting it directly through the controllers isn't ideal 👎

Same here. Ended up doing it manually event(new Illuminate\Auth\Events\Logout($user));

same issue...maybe we are missing function for handle it

+++

event(new \Illuminate\Auth\Events\Login('api', Auth(‘api’)->user(), false));

I triggered it manually. I can't get the current guard. I can only write it dead

+++

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shah-newaz picture shah-newaz  Â·  3Comments

gamelife1314 picture gamelife1314  Â·  3Comments

kofi1995 picture kofi1995  Â·  3Comments

therealmjk picture therealmjk  Â·  3Comments

lloy0076 picture lloy0076  Â·  3Comments