• Greetings,

    I know there is an API endpoint (/wp-json/jwt-auth/v1/token/validate) to validate the token. Is there a way to validate the token using a php function. My case scenario is, once a user is logged in he can request other data from the server. So while making a request for page_1 I would like to validate the token that is being sent with the AJAX request.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • When passing auth token, wp_get_current_user() can be used to get the current user. If the return id is 0 then the token is invalid. Simple, really.

    @jvertucio What about when we don’t have a current user and are coming from a third party scenario interacting with this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Validate access token using php function.’ is closed to new replies.