New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lumen 5.2 Issues! #384
Comments
Hrm I'm not sure what's up there; I know very little about Lumen but they both should be using the same Cache module. I guess it could just be a difference in bindings/DI? In any case, you should probably be using
Urgh ok this looks a lot trickier. Lumen "doesn't support" session-based auth, so by default it has you extend Auth with a custom, callback-based driver (see the first section in the docs here). Unfortunately, the So for now you either can not use |
I think the long-term solutions to the second problem are:
|
You need make the cache repository contract instead of container alias exclusive in laravel. |
I tried this already and it fails. Ends up throwing same "does not exist" error. Hence, I'm using the
Yeah, I figured this after i posted the issue here and like you suggested, The long-term solution would be to have a native support. For the time being, I'll probably write a custom provider. Thanks.
You mean do this: Thanks. |
I ended up creating a package with a custom Auth Driver for this package: https://github.com/irazasyed/jwt-auth-guard Works good for me :) |
So this PR should fix the number 1 issue i had: laravel/lumen-framework#324 |
Aha! Great news, I was wondering what could be going on there. |
irazasyed, nice package! would love to see all those methods ending up in tymon's driver :) |
@dani3l Thanks and yep, Would love to see that happening as well :) |
I think I will need to look at some of the points raised by @tdhsmith here, specifically around the fact that it feels a bit weird to add @irazasyed I know there are some subtle differences between our implementations of the Guard, but I would happily accept a PR to fill in the blanks so to speak, if you like? |
@tymondesigns Sure! I can send a PR. Would you like me to add those As far as There are some more issues though, Mostly with the Lumen, check out this: laravel/lumen-framework#291 Because of this issue, The |
@irazasyed I've already added the logout method, but we definitely need I guess i'm saying add everything in there 😄 and I may end up tweaking things if necessary when I'm at my machine later. Thanks for pointing out that issue with route params, maybe I will add the parser chain to the config - https://github.com/tymondesigns/jwt-auth/blob/develop/src/Providers/LumenServiceProvider.php#L155 Then you could just remove the RouteParams class, especially if it's not used, or indeed to add more to the chain. |
On the route params stuff, #361 has an example where it fails because there's no associated |
With configurable parser chain, Lumen users could sub in something like this until a change makes it to core: class LumenCompatibleRouteParams extends RouteParams
{
public function parse(Request $request)
{
return $request->route()[2][$this->key];
}
} (That magical 2 makes kittens cry. 😿) I guess technically we can already configure the chain by abusing |
@tdhsmith great point! Didn't think of the testing stuff |
Well I believe the PHPUnit helpers run everything through Kernel correctly, but who knows what other things exist in the wild, so we probably shouldn't assume |
I guess we could just throw a try catch around the damn thing and be done with it 😁 who uses the route parameters for this anyway? amirite |
@tymondesigns Sure. I'll do that soon :) As far as the route param issue is concerned, Since as @GrahamCampbell said, they're open for PRs. So i think we should just focus on fixing the root cause of this issue rather than making several changes in this project and making it more confusing for people (Though flexibility is good but too much of it also makes it look like its too complicated, it's simple until you make it complicated :P). What you could also do is, Add the input key option in config. So people can actually set a different name if they'd like. So for example, If someone wants to change the name to I'll probably create a new PR to the core framework soon. |
@tymondesigns Unfortunately it's a fatal error, not an exception, so we can't actually take the easy way out. 😑 But we can do some @irazasyed Yes I agree rapid changes and configuration bloat can be issues. As a compromise there could merely be programmatic access to the parsers through |
@tdhsmith That's doable and sounds good. For more advance developers who really want to dig into it and customize in depth, that should be good enough 👍 |
@irazasyed So i've gone ahead and added the missing methods. Should work as expected now I think |
so is Lumen 5.2 officially supported now? |
I've been trying to setup your latest code on latest Lumen 5.2.3, but the function extendAuthGuard in LumenServiceProvider,php creates an infinite loop trying to satisfy the $app['tymon.jwt.auth'] dependency for JwtGuard. All of it seems to come from AuthServiceProvider wanting to instantiate the guard to finish building the auth provider, specifically in function registerAuthenticator. Any idea? |
Nevermind, seems like the latest modifications have fixed the guard provider and the JWTGuard can be accessed with app('auth'). |
@tymondesigns I was away for sometime. Just saw, Everything seems to be good 👍 I'm closing this ticket now. Since all the issues mentioned seem to have been resolved in last few commits. |
So I've been testing this package in Lumen 5.2 and i came across the following issues:
1. Class cache.store does not exist
Path:
Tymon\JWTAuth\Providers\Storage\Illuminate
2. Fatal error: Call to undefined method Illuminate\Auth\RequestGuard::onceUsingId()
Path:
Tymon\JWTAuth\Providers\Auth\Illuminate
Is anyone else facing these issues? Is there a solution?
The text was updated successfully, but these errors were encountered: