jonsaw / amazon-cognito-identity-dart

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
204 stars 93 forks source link

fixes salt to be a fixed length unsigned hex valueto avoid BigInt par… #71

Open raywhiteside opened 4 years ago

raywhiteside commented 4 years ago

…sing errors

I was getting this error before this commit:

I/flutter (14876): FormatException: Invalid hexadecimal code unit U+002d. (at offset 1) I/flutter (14876): An unknown error occurred

The salt value that was coming back from Cognito had a negative sign in front of it (U+002d corresponds to the '-' character) and the BigInt.parse() function was failing to account for that. This change should detect the negative sign, strip it, and add the binary 1 in the top bit position to the first hex digit.

furaiev commented 4 years ago

Hi, I've copied this project in a separate package (because this one isn't supported anymore) https://pub.dev/packages/amazon_cognito_identity_dart_2 Welcome to contribute.