[Question] How to ignore path with specific HTTP method?
samuelgfeller opened this issue · 2 comments
samuelgfeller commented
Let's say the path GET /posts is public and should work without token but the POST, PUT, DELETE /posts path should be authorised; how can I do that?
Does it even make sense to want that?
tuupola commented
You could create a custom rule which is mixture of RequestMethodRule and RequestPathRule.
$app = new Slim\App;
$app->add(new JwtAuthentication([
"rules" => [
new YourCustomRule([
...
])
]
]));
samuelgfeller commented
I will try to thank you