You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Amplify Auth to sign users in, I've just run a few tests with no internet connexion (by setting Chrome to "offline"), and I noticed that the promise on Auth.signIn was not rejected properly, so catch() was never fired.
The second error shows that in Client.js, the fetch catch does not handle the possibility of no headers at all => var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];
chokes on this one, and never calls the callback with an error.
Which then does not reject the signIn promise (or any other promise for any other method that relies on this)
I assume that Client.js should check that headers are indeed received first, and if not, callback an error, so that promise based code can later handle the "No internet connection" properly. The signIn call currently fails silently, which is not good in terms of UX...
Thank you!
The text was updated successfully, but these errors were encountered:
I have not tried to find any temporary workaround for this, I'm confident that the AWS/Amplify Team will sort this out quickly :)
The only thing I can think of at the moment would be to use a timeout wrapper around the signin call, and consider it "failed due to network" if it does not complete within the given time range (could be 10, 15, 30s... 10s is already pretty long in my opinion)
This is hackish but it should work OK - at least users would eventually be notified that they couldn't sign in "due to network".
But again, please give the AWS/Amplify Team some time to address this issue properly ;)
Hi,
Using Amplify Auth to sign users in, I've just run a few tests with no internet connexion (by setting Chrome to "offline"), and I noticed that the promise on Auth.signIn was not rejected properly, so catch() was never fired.
I had a proper look at the error in console:
OPTIONS https://cognito-idp.eu-central-1.amazonaws.com/ net::ERR_INTERNET_DISCONNECTED
Uncaught (in promise) TypeError: Cannot read property 'headers' of undefined
The second error shows that in Client.js, the fetch catch does not handle the possibility of no headers at all =>
var code = (response.headers.get('x-amzn-errortype') || 'UnknownError').split(':')[0];
chokes on this one, and never calls the callback with an error.
Which then does not reject the signIn promise (or any other promise for any other method that relies on this)
I assume that Client.js should check that headers are indeed received first, and if not, callback an error, so that promise based code can later handle the "No internet connection" properly. The signIn call currently fails silently, which is not good in terms of UX...
Thank you!
The text was updated successfully, but these errors were encountered: