Auth.currentCredentials outage - CORS headers missing
See original GitHub issueDescribe the bug Starting today, Auth.currentCredentials() fails consistently with a CORS error.
This took down my production site. I imagine this issue might be from an AWS service rather than Amplify. Could you please help me route it to the correct contact?
To Reproduce
try {
credentials = await Auth.currentCredentials()
} catch (err) {
console.error("Failed to get credentials: ", err);
}
Observation
The call hangs for about 10 seconds, then returns this object:
credentials: {"$metadata":{"attempts":1,"totalRetryDelay":0}}
Javascript log (Chrome)
Access to fetch at 'https://cognito-identity.us-east-1.amazonaws.com/' from origin '[...]' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Expected The credentials object should be populated with the credentials (identityId, etc)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
@andriworld Multiple AWS services are down https://www.reddit.com/r/aws/comments/k0sd0l/cloudwatch_useast1_problems_again/
@sammartinez, you closed the issue @lafiosca and I mentioned. I just wanted to make sure that the information isn’t lost.
When an outage like this happens, we get a type error because there needs to be a guard in place to prevent evaluating methods on undefined. That way, we can provide our users with more meaningful errors.
Will this card address the defect on this line: https://github.com/aws-amplify/amplify-js/blob/ba8a73f41db6411b91b208fea3202408c55f029b/packages/amazon-cognito-identity-js/src/Client.js#L98
If not, can we re-open #7286 or create a new issue to account for this change? I know this is kind of trivial, but I think that consumers of a library should be able to count on the library guarding against runtime errors like this.
Thanks!!
Edit: I just re-read this and realized that it may not come across as positively as I intended, but I couldn’t figure out how to address the ambiguous tone. Please know that I appreciate your efforts very much and this is not meant to be argumentative or critical.