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

Be compatible with different laravel and swoole adapters

Open v131313 opened this issue 2 years ago • 4 comments

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.

v131313 avatar Jan 04 '23 16:01 v131313

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

mfn avatar Jan 04 '23 16:01 mfn

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.

dmason30 avatar Jan 04 '23 17:01 dmason30

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

Messhias avatar Jan 23 '23 16:01 Messhias

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

mfn avatar Feb 21 '24 14:02 mfn