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

169
Vistas
Axios - Password Exposed in res.config

I am making an axios post request to my server to log a user in and logging the response in the console to observe the data being returned:

const Login = () => {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");

  const submitForm = (e) => {
    e.preventDefault();

    axios
      .post("http://127.0.0.1:3000/login", { email, password })
      .then((res) => console.log("res", res))
      .catch((err) => console.log("err", err));

    console.log({ email, password });
  };

I generate a token when the user successfully logs in, returning the user's data alongside this newly generated token. As you can see here, I am deleting the user password from the response body in order to not expose the password:

const generateToken = (user) => {
  delete user.password;

  const token = jwt.sign(user, config.appKey, { expiresIn: 86400 });

  return { ...user, ...{ token } };
};

Here is the logged data in the console. In image no.1, you can see there is no password in the data portion of the response.

enter image description here

However, in the config portion of the response, the password is exposed (see Image no.2). My question is, is this something to be concerned about? If so, how do I remove the user's password from the response altogether?

enter image description here

Thanks in advance!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If your connection is secure (HTTP over TLS, ...), it is not something you need to be concerned about.

The HTTP response does not include it, since the actual response payload is res.data.

It is stored in the axios response object, since res.config is the config that was provided to axios for the request. But it is not stored in any persistent storage.

over 4 years ago · Santiago Trujillo Denunciar
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