I was using Firebase authentication by Email/Password on my react-native app and doing emailUpdate through the app successfully , until i decided to move to new Firebase project with the same app changing the Config keys only.
Every thing is working fine I can delete existing email, create a new email , only when I try to updateEmail, I receive the following error :
[firebaseerror: firebase: please verify the new email before changing email. (auth/operation-not-allowed).]Note: I am not using or requesting any email verification in my code.
Thanks for any support !
2
Answers
I’ve been emailing with Firebase Support and it seems as though this is, indeed, a bug in the system. However, the representative emailing me provided a temporary workaround, and it works!!
The ‘issue’ is caused by ’email enumeration’, which is now enabled by default as of September 15th, 2023 according to the release notes.
The workaround is to disable email enumeration for your project.
It’s a little complicated (pending on your comfort level with command line), but basically you just install Google Cloud SDK (I did it with hombrew). If you do it with home-brew, you can run the commands in any directory, though I ran everything from home directory (not root of project)
then initialize the project:
Once done, you can simply follow the instructions provided in the link to disable email enumeration for your project, which should solve the problem.
This worked for my iOS projects, but since the solution isn’t tied to specific platform, it should work for React Native as well.
I’ll post back here once I receive the proper solution to the problem, as from what I can tell the email enumeration is a security feature that could be beneficial to prevent fraud in your app. Until then, I hope this helps!
Can anyone confirm if updateEmail for Firebase is working in general? I’ve pretty much tried everything and somehow I just keep getting
"I/flutter (21000): [firebase_auth/operation-not-allowed] The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section. [ Please verify the new email before changing email. ]".
While I’m 100% it’s enabled.
Anyone have any thoughts?