amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

parseCognitoWebResponse with useCodeGrantFlow() only works on Chrome #46

Closed megyfexid closed 6 years ago

megyfexid commented 6 years ago

On Safari and Firefox the makePOSTRequest at the end of getCodeQueryParameter inside parseCognitoWebResponse always fails with "error": "invalid_grant". This causes an infinite loop of parseCognitoWebResponse constantly requesting new code tokens.

Oddly it works fine on Chrome but fails on the other browsers.

megyfexid commented 6 years ago

Sorry my mistake.

I didn't realise getSession and parseCognitoWebResponse are both asynchronous functions.

Reading the source code is your friend. :)

mlisonek98 commented 4 years ago

I have this issue as well, how did you end up solving it?