firebase-tools
firebase-tools copied to clipboard
Support verifyBeforeUpdateEmail in Auth Emulator
[REQUIRED] Environment info
9.12.0
firebase-tools:
macOs
Platform:
[REQUIRED] Test case
I've provided an example in web for ease of illustration, but this is also a problem for iOS & android. This bugs stops verifyBeforeUpdateEmail() from being tested with the auth emulator for React Native Firebase & also Flutterfire as mentioned here.
<html>
<script src="https://www.gstatic.com/firebasejs/8.6.2/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.2/firebase-auth.js"></script>
<script>
var firebaseConfig = {
// Your web app's Firebase configuration
};
firebase.initializeApp(firebaseConfig);
// To see it work using live auth server, just uncomment this line.
firebase.auth().useEmulator("http://localhost:9099");
async function signIn() {
const email = '[email protected]';
const password = 'zxcvbn321';
const userCred = await firebase.auth().createUserWithEmailAndPassword(email, password);
const user = userCred.user;
await user.verifyBeforeUpdateEmail('[email protected]');
}
</script>
<button onclick="signIn()">sign in</button>
</html>
[REQUIRED] Steps to reproduce
Add your project's firebase config to the firebaseConfig object.
Run this code in your browser and press the "sign in" button. You will see the error in your Chrome console.
Comment out this line firebase.auth().useEmulator("http://localhost:9099");, refresh browser and click button again. Note there is no error in the console.
[REQUIRED] Expected behavior
Same behaviour when using auth emulator and when not using auth emulator.
[REQUIRED] Actual behavior
internal error emanating from the auth emulator.
Error:
{
"code": "auth/internal-error",
"message": "{
"error":{
"code":501,
"message":"VERIFY_AND_CHANGE_EMAIL",
"errors":[{"message":"VERIFY_AND_CHANGE_EMAIL","reason":"unimplemented"}],
"status":"NOT_IMPLEMENTED"
}}"
}
Thanks for filing the issue! As shown in the error message, this feature is currently unimplemented in the Auth Emulator. We are unable to promise any timeline for this, but if others also have this request, adding a +1 on this issue can help us prioritize adding this to the roadmap. The Auth Emulator is also open source and feel free to create a Pull Request to help make it happen.
(Googler-only internal tracking bug: b/190449864)
Could you please provide an update on the progress of implementing the emulator testing feature? This is a commonly encountered use case and I am curious to know if there are any plans to include it in the future. Thank you!
Hello dear Firebase team.
Since other issues are getting closed as duplicates, and this one is kept alive, I would like to mention another usecase closely linked with this one, resulting with the same error message.
In my case, I'm not relying on verifyBeforeUpdateEmail
I use generateVerifyAndChangeEmailLink in order to be able to use my own custom email template and send it from my transactional email provider.
I believe verifyBeforeUpdateEmail uses generateVerifyAndChangeEmailLink underneath.
Please make sure this option is also implemented in firebase auth emulator, when you decide to address this ticket.
This is now supported in release v13.17.0. https://github.com/firebase/firebase-tools/releases/tag/v13.17.0