Question

Best way to update email attribute

  • 7 March 2024
  • 2 replies
  • 16 views

Badge

When a new user registers in my app, I also set the email attribute in RC.

However, Firebase for Unity doesn’t support the ability to verify an email address before updating it.

This creates a situation where a user can update their email address to a wrong one (mistype). At this point I also fire an update to the $email attribute in RC with their new email. Meanwhile, they receive an email stating that someone updated their account’s email address (which they can see is mistyped). The email gives them the option to click a link and revert to their old email address. If they click the link, Firebase will revert to the old email address, while RC will reference the new one in the attributes.

I can’t use the email verification flow in my app and ensure that the RC attribute updates only when an email is verified, because the verification flow opens only if the account is not verified. Verification happens outside the app.

I thought I can read the RC attributes in-app and compare to the latest account email but reading attributes is possible only server-side.

My other idea is to update the attribute every time I login the user in RC (upon launching the app), but that feels unnecessary.

I am not using the RC/Firebase integration. Also, I kinda don’t want to go down a complex admin SDK  rabbit hole just to update the attribute.

 

My question is how can I ensure the RC email attribute is the user’s current email address considering users’ ability to update their email addresses and revert to the old ones in case of an error?


This post has been closed for comments

2 replies

Userlevel 3
Badge +5

Hi! Unfortunately based on what you have described, I believe that your best option is to update the email attribute every time you login the user in RC in order to verify that the email is current.

Badge

Hi! Unfortunately based on what you have described, I believe that your best option is to update the email attribute every time you login the user in RC in order to verify that the email is current.

Thanks for the input, Wes. Do you think the Firebase/RC integration could solve this case?