jwt-auth icon indicating copy to clipboard operation
jwt-auth copied to clipboard

Listening for Auth events

Open wemersonjanuario opened this issue 8 years ago • 13 comments

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?

wemersonjanuario avatar Oct 29 '16 13:10 wemersonjanuario

I have same problem. can you find any solution ?

ahmadbadpey avatar Feb 14 '17 08:02 ahmadbadpey

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.

ziazon avatar Mar 11 '17 02:03 ziazon

Any official JWT Event? still need a built in solution

wemersonjanuario avatar Apr 14 '17 03:04 wemersonjanuario

+++

gitkv avatar Aug 15 '17 07:08 gitkv

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

chrispage1 avatar Aug 10 '18 10:08 chrispage1

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

fgilio avatar Sep 18 '18 18:09 fgilio

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

nguyenphuocnhatthanh avatar Dec 04 '18 07:12 nguyenphuocnhatthanh

+++

Mapteg34 avatar Sep 06 '19 09:09 Mapteg34

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

pgyf avatar Nov 06 '20 02:11 pgyf

+++

fabioborella-smash avatar Dec 02 '20 10:12 fabioborella-smash

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

For now am using this, until PR to fire events is merged by @tymondesigns

kamasuPaul avatar Oct 28 '21 15:10 kamasuPaul

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

For now am using this, until PR to fire events is merged by @tymondesigns

I think it will never be merged... Project is literally dead. Better look to forks like https://github.com/PHP-Open-Source-Saver/jwt-auth and try to create PR there

leon0399 avatar Oct 28 '21 17:10 leon0399

Happy to inform you, that and many other issues are now resolved in this fork: https://github.com/PHP-Open-Source-Saver/jwt-auth

leon0399 avatar Nov 22 '21 09:11 leon0399