else if (grant_type === "refresh_token") {
var cognitoResponse = await cognitoSP.initiateAuth(params).promise(); // Call Cognito with refresh token to get refreshed id and access tokens
var access_token = cognitoResponse.AuthenticationResult.AccessToken;
var id_token = cognitoResponse.AuthenticationResult.IdToken;
}
The promise of cognitoSP.initiateAuth(params) may throw an error.
IMO, we should add a try catch to properly handle this.
@ amplify/backend/function/amplifyIdentityBrokerToken/src/index.js
The promise of
cognitoSP.initiateAuth(params)
may throw an error. IMO, we should add a try catch to properly handle this.