PHP-Open-Source-Saver / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
MIT License
684 stars 106 forks source link

Be compatible with different laravel and swoole adapters #202

Open v131313 opened 1 year ago

v131313 commented 1 year ago

Summary

look at file PHPOpenSourceSaver\JWTAuth\Providers\LaravelServiceProvider:45 if (isset($_SERVER['LARAVEL_OCTANE'])) { $clear = function () { JWTAuth::clearResolvedInstances();

You clear only when octane is enabled, i use larave-S yet another laravel + swoole adapter and looks like this code don`t do any "good" for me.

how about rewrite to: if (isset($_SERVER['LARAVEL_OCTANE']) || extension_loaded('swoole') || extension_loaded('openswoole') don`t know - do we need cleaners when using octane and RoadRunner server.

mfn commented 1 year ago

Sounds reasonable to me; @dmason30 are you still around? WDYT?

dmason30 commented 1 year ago

Sounds reasonable to me; @dmason30 are you still around? WDYT?

Its clearing using Octane events so i am not sure what allowing anything but LARAVEL_OCTANE enabled code into that block would achieve.

Messhias commented 1 year ago

But I don't get the issue, what's the problem to run only when the env variable is setup?

mfn commented 5 months ago

@v131313 your request sounds reasonable, I suggest you make a PR to evaluate!