-
Notifications
You must be signed in to change notification settings - Fork 141
Slim v4 support #169
Comments
@tuupola Mika, as stupid as the above question might seem (considering that both Slim v3 and Slim v4 are PSR-7 compatible), currently the middleware does not work with Slim v4 when used together with I prepared an update that adds support for the package here: |
Slim 4 will have PSR-15 support so this middleware should be supported too. Currently the problem is that |
For Slim 4 support |
@tuupola on slim 4, when require Can you update |
All versions of Observe the requirement on packagist (as per the link you sent abovce):
You probably want to call |
Yeah, that is true, but got this issue when using with
|
That's not really a problem of the middleware, is it? |
@gravataLonga you are obviously doing something wrong. PHP-DI has nothing to do with it. Here, let mi give you a tip. There are basically 3 possible cases how you add this (or any other) middleware to slim (both v3 and v4), to the whole app, to a certain group or to a single route: $slim = new Slim\App(...);
$authOptions = [...];
// add to the whole app / middleware stack
$slim->add(new JwtAuthentication($authOptions));
$slim
->group('/foo', function ($group) use ($authOptions) {
$group
->get('/bar', function (Request $request, Response $response) {
echo 'The end. 42';
})
// add to the single route
->add(new JwtAuthentication($authOptions));
})
// add to the whole group
->add(new JwtAuthentication($authOptions)); |
I'm obviously not doing something wrong, if you get class from container it will work. Take this example: This not work:
This will work:
|
And again, it's not a problem of this middleware. First, check the callable resolver you are using, this is most problably your misconfiguration issue. |
I'm don't think that is a bug of this middleware, only point out that the problem is another than "i'm don't known what are doing". Will try to debugging.. and yes, i'm think the problem is php-di. ;) |
@dakujem only for reference... |
Any plans to support the upcomming Slim v4?
I'm currently starting to build an app based on v3, but decided to switch to Slim v4 (http://slim-website.lgse.com/docs/v4/start/upgrade.html), so it might be a good opportunity to also help with the integration, I have not yet startet to investigate whether the changes in Slim v4 actually mean any changes to this middleware are needed.
The text was updated successfully, but these errors were encountered: