Authenticating with device management will store device keys in the storage mechanism. If some of those keys are removed the authentication flow will fail and not let the user to authenticate.
This change checks if all the keys are available in storage, otherwise it will return null. When null is returned then no device keys are added to the RespondToAuthChallenge request, which allows to continue the authentication flow.
Test cases:
it checks if a device key was included in the ResponseToAuthChallenge request.
it checks that a device key was not included in the ResponseToAuthChallenge request when any device key is deleted from storage.
Description of changes
Authenticating with device management will store device keys in the storage mechanism. If some of those keys are removed the authentication flow will fail and not let the user to authenticate.
This change checks if all the keys are available in storage, otherwise it will return null. When
null
is returned then no device keys are added to theRespondToAuthChallenge
request, which allows to continue the authentication flow.Test cases:
ResponseToAuthChallenge
request.ResponseToAuthChallenge
request when any device key is deleted from storage.Issue #, if available
https://github.com/aws-amplify/amplify-js/issues/9366
Description of how you validated changes
smoke testing
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.