I am trying to update a user in a custom database to mark them has verified.
When I try to call the update I received this error message:
“User with old email does not exist in Auth0 database”
My code looks like this;
var request = new UserUpdateRequest()
{
EmailVerified = update.EmailVerified,
Connection = _managementClient.Connection,
};
var user = await _managementClient.Client.Users.UpdateAsync(id, request, cancellationToken);
What is causing this error message? I am not changing the email address and the user still exists in the Auth0 admin portal.
Hey! I ran into this same issue when the “Import Users to Auth0” toggle turned off. I initially had it off since I no longer was using the custom database scripts. But when I turned “Import Users to Auth0” back on I was able to modify the user’s email. I then read Auth0’s documentation and they say this:
“Make sure to leave the Import Users to Auth0 option turned on. If you turn this option off Auth0 will only use the scripts to authenticate and perform other user actions instead of using the users that were imported locally.”
So toggle has to stay on indefinitely, even after your migration period is over, for auth0 to register migrated users as part of the “Auth0 database”.