AWS Cognito NotAuthorizedException A client attempted to write unauthorized attribute
In the AWS website go to your User Pool -> Apps -> Show Details -> Set attribute read write permissions. Make sure every attribute you are trying to write i in the writeable attributes list and they have a checkmark.