from the docs that function is only applicable if you want your user to be able to login with an email link:
https://anvil.works/docs/users/authentication_choices#sign-in-with-email-link
But I don’t think it’s relevant here.
When i’ve thought about this before I would take the twitter approach:
- request a new email
- twitter sends an email link with a code
- in twitter you fill in the code
- if the code matches you win and the email get’s changed
So in anvil something like:
"""
validate the new email is an email address
check the email address doesn't already exist
send the email with a random code
store code in the user_row using anvil.secrets.encryp_with_key
in the app - ask the user to check their email and enter the code in the box
Server call to check the codes match - great - if not try again with new code or different email
if they navigate away from the page and back then it should start the process again
"""