Tmeister / wp-api-jwt-auth

A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API
GNU General Public License v2.0
549 stars 159 forks source link

Fix warning `register_rest_route was called incorrectly.` #243

Closed 5baddi closed 1 year ago

5baddi commented 2 years ago

Hi @Tmeister :wave:

I just opened a new pull request that includes a fix to ignore the warning of missing argument: permission_callback.

Since WP 5.5.0 there is notice if your registration of REST API route is not including the permission_callback, you get the notices:

register_rest_route was called incorrectly. The REST API route definition for /jwt-auth/v1/token is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback...

register_rest_route was called incorrectly. The REST API route definition for /jwt-auth/v1/token/validate is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback...

Thanks.