Support » Plugin: JWT Authentication for WP REST API » Function register_rest_route was called incorrectly.

  • Resolved Tayyab Chaudhary

    (@mtachaudhary770)


    Hello Support,

    I am getting yhe followong error on WordPress admin dashboard. Can you please resolve this ASAP?

    Notice: Function 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.

    Notice: Function 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 and regards
    Tayyab

Viewing 3 replies - 1 through 3 (of 3 total)
  • tinhochu

    (@tinhochu)

    you can change this currently while they make this change like this:

    wp-content/plugins/jwt-authentication-for-wp-rest-api/public/class-jwt-auth-public.php:

    register_rest_route($this->namespace, 'token', [
                'methods' => 'POST',
                'callback' => [ $this, 'generate_token' ],
                'permission_callback' => '__return_true'
            ] );
    
            register_rest_route($this->namespace, 'token/validate', [
                'methods' => 'POST',
                'callback' => [ $this, 'validate_token' ],
                'permission_callback' => '__return_true'
            ] );

    from line 75 to 85

    Hope this helps, worked for me.

    I’m trying to make a PR for this, but not sure where!

    The fix works. Would be great if this can be published in the next release!

    Plugin Author Tmeister

    (@tmeister)

    This issue was addressed in the latest updates

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.