Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda