Change user's email after confirmation

Hi.
In default Bubble setting, “update users credential” change the user’s email and lets the user log out immediately .
However, if a user mistakenly input the wrong new mail adress, he could never log in.
To prevent this, I’d like to change user’s email after email confirmation.
Someone know how?

You could follow the same flow usually used for password recovery.

Since you cannot send a “send confirmation mail” to a dynamic mail id, Use OTP verification.

  1. Generate a OTP, save it in database.
  2. Send a mail to the new email id entered in an input field by user.
  3. Have them enter the said OTP correctly in the next field which would imply that the mail id is not only correct, it is owned by them.
  4. Give them an additional notice that this will permanently change their email id (Just for UX) This also probes them to enter their existing password.
  5. Once they click confirm, run “update the user’s credentials”
    image

Make sure to run the “generate otp” and “match OTP” at backend workflow for maximum security. Also have a field to expire otp and update that as expired after a certain time, or delete it from the system.