Answers for "how to refresh idToken in Cognito"

0

how to refresh idToken in Cognito

var refreshToken = localStorage.getItem("refreshToken");
var token = new AmazonCognitoIdentity.CognitoRefreshToken({ RefreshToken: refreshToken })
cognitoUser.refreshSession(token, function (err, session) {
    console.log(err, session);
    var idToken = session.getIdToken().getJwtToken();
})
Posted by: Guest on May-30-2021

Browse Popular Code Answers by Language