Reputation: 1090
I set up an Auth0 connection database, configured as a custom database with automatic migration turned on. Working great in general. I also successfully set up a rule to force email verification, needed for new signing up users and old users with unverified emails.
Of course, all migrated users are forced to verify their email address; but my biz requirement is that's should happen just for the users who haven't verified their email yet, it's annoying forcing it for old users with already verified emails.
I have a source field for that on the legacy DB, but I'm not sure how I can migrate the user including the verified_email
state. My current scripts for the custom database returns these values:
Login script:
login(email, password, callback)
... returning on callback...
{
user_id: ...,
nickname: ...,
email: ...,
}
GetUser script:
getByEmail(email, callback)
... returning on callback...
{
user_id: ...,
nickname: ...,
email: ...,
name: ...,
given_name: ...,
family_name: ...,
}
Upvotes: 1
Views: 227
Reputation: 36
You just need to edit your Login script to get that property as well and set it to the email_verified
key. Just like your script creates a profile that has user_id
, email
, and other stuff, you just need to add a line to include email_verified
in the profile and populate it with the correct data from your legacy datastore. The data you add to the profile when importing is totally up to you.
In this specific case, the value required is a boolean, so it would be just true
, without the quotes.
Upvotes: 2