InvalidParameterException: Cannot modify the non-mutable attribute identities

0

InvalidParameterException: Cannot modify the non-mutable attribute identities

I get above error while calling Auth.updateUserAttributes(user, attributes) function using amplify sdk for react native even though i am not trying to update this attribute. problem occurs only with users loging in using federated identity (well since only them actually have identities attribute set) have anyone else encountered this problem ? any advice ?

posta 5 mesi fa204 visualizzazioni
1 Risposta
0

Can you console log what attributes you are trying to update? From the error you must have passed some attributes that are not supposed to be changed like email or similar.

Also Auth.updateUserAttributes expects that before you called Auth.currentAuthenticatedUser, in that case the user used as argument will be updated as a side effect with current user.

profile picture
ESPERTO
con risposta 5 mesi fa
  • so since i assumed properties that doesn't change just won't even attempt to be updated at first i tried to just pass whole object that looked like this { "sub": "<user id>", "identities": "[<your usual default config here>]", "email_verified": false, "email": "<email>, "name": "Aaa", "picture": "image.jpg" }

    than i tried sending this

    { "sub": "<user id>", "email_verified": false, "email": "<email>, "name": "Aaa", "picture": "image.jpg" } that didn't worked either so i just sent this: { "name": "Aaa" } and it still doesn't work, can you tell me what i might be doing wrong ? i am passing user gathered from Auth module and no matter what i try to update cognito screams at me that i can't update identities attribute, any ideas what might be wrong here ?

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande