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

327
Vistas
Error: Local storage is missing an ID Token, Please authenticate While changing current password AWS amazon-cognito-identity-js

I'm trying to change current password my solution is

exports.changePassword = async function (body) {
    return new Promise((resolve, reject) => {
        const userData = {
            Username: body.email,
            Pool: userPool
        };
        const cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
        if (cognitoUser) {
            cognitoUser.getSession(function (err, session) {
                    console.log("🚀 ~ file: auth.service.js ~ line 283 ~ session", session)
                if (err) {
                    console.log("🚀 ~ file: auth.service.js ~ line 284 ~ err", err)
                    reject(err);
                } else {

                    cognitoUser.changePassword(body.currentPassword, body.newPassword, function (
                        err,
                        res
                    ) {
                        if (err) {
                            console.log("🚀 ~ file: auth.service.js ~ line 291 ~ err", err)
                            reject(err);
                        } else {
                            resolve(res);
                        }
                    });
                }
            });
        } else {
            reject('User is not authenticated')
        }
    });
};

the cognito session is valid for one hour so when I try to getSession the session is null and reject with Error: Local storage is missing an ID Token, Please authenticate

about 4 years ago · Juan Pablo Isaza
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