slim-jwt-auth
slim-jwt-auth copied to clipboard
Dynamic route in ignore rule not working
When a route contains a dynamic element and is passed to the ignore
directive in the constructor, the route is not ignored.
For example, if the ignore
directive looks like this:
'ignore' => [ '/user/{id:[0-9]+}/activate/' ]
And we visit the URL:
https://example.com/user/1/activate/
We receive the 401, because no token is passed. Is there a workaround for this?
Normal regexps should work. Something like following?
'ignore' => [ '/user/[0-9]+/activate/' ]
Yes, that works. The issue I have is that I am actually building the ignore
array from a YAML file, which also builds the routes in Slim, so it's nice to be able to use Slim's pattern for the ignore
path. See the PR I have submitted, it converts Slim's patterns to PCRE-compliant strings.