Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support verifyBeforeUpdateEmail in Auth Emulator #3424

Closed
russellwheatley opened this issue May 28, 2021 · 4 comments
Closed

Support verifyBeforeUpdateEmail in Auth Emulator #3424

russellwheatley opened this issue May 28, 2021 · 4 comments

Comments

@russellwheatley
Copy link
Member

russellwheatley commented May 28, 2021

[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 = 'fake@email.com';
    const password = 'zxcvbn321';
    const userCred = await firebase.auth().createUserWithEmailAndPassword(email, password);
    const user = userCred.user;
    await user.verifyBeforeUpdateEmail('your-own-email@gmail.com');
  }

</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"
	}}"
}
@yuchenshi
Copy link
Member

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)

@yuchenshi yuchenshi changed the title auth emulator throws error when using verifyBeforeUpdateEmail() Support verifyBeforeUpdateEmail in Auth Emulator Jun 8, 2021
@lucasilverentand
Copy link

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!

@maciejgoscinski-latrace

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.

@naoina
Copy link
Contributor

naoina commented Sep 12, 2024

This is now supported in release v13.17.0.
https://github.com/firebase/firebase-tools/releases/tag/v13.17.0

@aalej aalej closed this as completed Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants