Variable firebase authentication

Hello,

I have a problem when using the “loginWithMoralis” moralis api, this method triggers the Metamask pop-up and then stores the wallet address in the firebase authentication table. the problem is that this Moralis method stores the wallet address at firebase in the “DisplayName” variable instead of creating a new variable and therefore I cannot add the first and last name to this user since the variable provided for this has been filled.

Does anyone have a solution for this?

Thankyou.

maybe you can update the code that saves that address to save it in a different variable?

it’s the moralis api that saves the address in the firebase variable and not my code

could you look in moralis code an try to modify it?

even if i manage, we can’t add new variables in firebase authentificzation

after a user is authenticated, you can’t associate more info with that user somehow?

You can change the displayName with:

import { getAuth, updateProfile } from '@firebase/auth';

updateProfile(auth.currentUser, {
    displayName: 'John Smith',
})

But this will mean the wallet address won’t be available - you could save it elsewhere in another field like phoneNumber and use that.

If you want to add another variable or field, you will need to use your Firebase database for the user’s data instead.

Hello, Thank you for your help, finally I turned to the firestore solution for any additional information from the user

Hello, could you tell me how to disconnect the metamask session when using “signInWithMoralis”