Authentication - Feature - Immutable attributes checking #7071
Labels
amazon-cognito-identity-js
Used for issues related to this specific package within the monorepo
feature-request
Request a new feature
Is your feature request related to a problem? Please describe.
On
cognitoUser.completeNewPasswordChallenge
the second function variable is the users attributes, what I've done is on the callback forcognitoUser.authenticateUser: newPasswordRequired
returns the attributes, I set them in my state. However due tocognitoUser.completeNewPasswordChallenge
accepting attributes back that are immutable,email_verified
etc, I think the challenge response from cognito inChallengeParameters
should have an array ofimmutableAttributes
that way we can check any attributes aren't immutable before they get sent back to to Cognito for challenges, updating attributes etc? I think this would flow a lot easier.Describe the solution you'd like
Array of
immutableAttributes
from the Cognito endpoint after you invoke a login, you will get a challenge such asNEW_PASSWORD_REQUIRED
. Then within the package we check against immutable attributes and remove them.Describe alternatives you've considered
Manual checking outside the package, but this could be a check already done within the package for ease.
Additional context
Example usage currently:
Purposed change (when array added to Cognito endpoint) is to add the validation check to :
amplify-js/packages/amazon-cognito-identity-js/src/CognitoUser.js
Line 604 in 958f61e
The text was updated successfully, but these errors were encountered: