Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pass jwt token in header using Axios #40

Closed
elmcapp opened this issue May 8, 2022 · 1 comment
Closed

Can't pass jwt token in header using Axios #40

elmcapp opened this issue May 8, 2022 · 1 comment

Comments

@elmcapp
Copy link

elmcapp commented May 8, 2022

Can't not pass The JWT token in the header

 const options = {
      method: "get",
      url: `${url}/wp-json/wp/v2/media`,
        headers: {
          Authorization: `Bearer ${token}`,
        },
      cancelToken: source.token,
    };

    axios(options)

The plugin does not see The JWT in the header. In the general tab I have header turn on with Authorization

This use to work on the prevous version

@Lupul
Copy link
Contributor

Lupul commented May 15, 2022

Can you reproduce the problem using curl?

JWT="JWTKEY"
curl "https://domain.com/wp-json/wp/v2/media" -H "Authorization: Bearer $JWT" -v | jq

Also make sure you have "All WordPress endpoints checks for JWT authentication" option checked on the "General" plugin settings page:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants