After receiving the object credential.user
, my goal is to create a modified clone of it and pass it to a function.
const credential = await this.afAuth.auth.signInWithEmailAndPassword(email,password);
var userInfo= await credential.user
userInfo.displayName= name
return this.updateUserData(userInfo);
Unfortunately, upon attempting to do so, I encountered the following message:
ERROR Error: Uncaught (in promise): TypeError: "displayName" is read-only
emailLogin/<@http://localhost:4200
I am seeking guidance on how to properly clone an object retrieved from an asynchronous function and modify one of its attributes.