I have a question about how to enrich a user’s profile with metadata. I’m using React with a C# API. When a user signs up for the service (either with an email/password or through a provider), I’d like to extract their name and avatar and store it as metadata so that they can change it in my app without having to change it in their Google account (or wherever). The name will essentially become their display name in my app and the avatar is meant as an initial placeholder that they can change later if they choose.
I’ve seen examples of how to do this with Actions using api.user.setUserMetadata when they log in but I don’t want to do it on every login, just when they sign up. Is this just a matter of checking whether the specified user_metadata field has been set already?
I also tested the PreUserRegistration flow but that seems to be limited to Email/Password accounts and not ones from other providers.
Assuming I have a way of storing that info in user metadata, what’s the normal process for updating it with React? Should I make an API call to Auth0 directly from the appropriate page in my app or do you normally submit the info to the server and have my backend API make the request? If it’s the former, I think I’m having trouble wrapping my head around how to prevent someone submitting a request to change someone else’s account.