Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Can't get the response I want from Wordpress JWT Auth using React (Native). It works fine using Postman

I have an old Wordpress site. I installed the plugin JWT Auth so my React Native app can authenticate users from this website.

I have this React code:

function LoginScreen({navigation}) {
    const [username, setUsername] = React.useState('')
    const [password, setPassword] = React.useState('')
    const apiurl = 'https://wordpresswebsite.com/wp-json/jwt-auth/v1/token/'

    function submitLogin() {
                    
        axios.post(apiurl, {
            body: JSON.stringify({ username: username, password: password })
        })
        .then(function(response) {
            console.log(response)
        })
        .catch(function(err) {
            console.log(err)
        })

    }
}

The response I get is code: "jwt_auth_no_auth_header"

However, when I use Postman, I get the expected "code":"jwt_auth_valid_credential" without any problems.

What is going on here and how can I get the result like in Postman?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!