diff --git a/index.js b/index.js index c912158..a6f9440 100755 --- a/index.js +++ b/index.js @@ -41,9 +41,10 @@ const { } }); - AWS.config.credentials.refresh(async (error) => { + AWS.config.credentials.refresh( error => { if (error) { console.error(error); + process.exit(1); } else { console.log(`AWS_DEFAULT_REGION=${AWS.config.region}; export AWS_DEFAULT_REGION;`); console.log(`AWS_ACCESS_KEY_ID=${AWS.config.credentials.accessKeyId}; export AWS_ACCESS_KEY_ID;`); @@ -54,6 +55,7 @@ const { }, onFailure: function (err) { console.error(err.message || JSON.stringify(err)); + process.exit(1); } }); })(); diff --git a/package.json b/package.json index 325afe5..564c240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cognito-agent", - "version": "1.0.0", + "version": "1.0.1", "description": "Authenticate with AWS Cognito and retreive credentials to use in your environment", "main": "index.js", "bin": {