How to make user attributes from AWS userpool updateable?

Viewed 377

I am trying to update attributes from users from a AWS Cognito userpool with AWS Amplify.

try {
    const user = await Auth.currentAuthenticatedUser();
    await Auth.updateUserAttributes(user, {
        'nickname': 'newtestname'
    });
} catch (error) {
    console.log(error);
}

But I get the following error:

InvalidParameterException: user.nickname: Attribute cannot be updated.

I would expect it to be updateable because I made the attributes writable in the userpool-client section in my SAM template:

WriteAttributes:
        - email
        - nickname
UserPoolId: !Ref MyCognitoUserPool

This is also reflected correctly in the console: enter image description here

I have no app client secret and all auth flows enabled. The security configuration is set to enabled. Users can register, so I assume that the Amplify config in the client is alright.

What is wrong here?

1 Answers
Related