aws-observability / aws-rum-web

Amazon CloudWatch RUM Web Client
Apache License 2.0
119 stars 65 forks source link

fix: Save deserialized credential object to Authentication member #435

Closed adebayor123 closed 1 year ago

adebayor123 commented 1 year ago

Details

Currently in our Authentication and EnhancedAuthentication, we save credential object as serialized string values. Then, as we read the serialized string from Storage, we parse the string into a Credential object.

However, in AnonymousStorageCredentialsProvider, we overwrite the local member variable credential with the serialized string instead of the parsed object. As a result, any situation that requires reading of the credential from storage leads to: TypeError: this.credentials.expiration.getTime is not a function.

This PR removes the unnecessary step to overwrite the local member this.credential with the serialized string.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.