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

signInWithEmailAndPassword method throws an incorrect error when Authentication emulator is enabled #3898

Closed
lysov opened this issue Nov 11, 2021 · 6 comments · Fixed by #5258

Comments

@lysov
Copy link

lysov commented Nov 11, 2021

Given an invalid email argument and a valid password argument. signInWithEmailAndPassword method from JavaScript SDK throws an error with a code auth/invalid-email using an actual Firebase project. The method throws an error with a code auth/missing-email when an Authentication emulator is enabled.

Environment info

firebase-tools: 9.22.0
firebase: 9.2.0
Platform: macOS 12.0.1

Test case

When a function signInWithEmailAndPassword is called using Authentication emulator, it's behavior should match real Firebase Authentication.

Steps to reproduce

Given Firebase app is initialized and Authentication emulator is enabled. signInWithEmailAndPassword throws an error with a code auth/missing-email

const invalidEmail = '';
const validPassword = 'wowsuchsecureverysafepassword';
signInWithEmailAndPassword(getAuth(), invalidEmail, validPassword);

Expected behavior

Given Firebase app is initialized and Authentication emulator is enabled. signInWithEmailAndPassword should throw an error with a code auth/invalid-email

const invalidEmail = '';
const validPassword = 'wowsuchsecureverysafepassword';
signInWithEmailAndPassword(getAuth(), invalidEmail, validPassword);
@google-oss-bot
Copy link
Contributor

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@lysov
Copy link
Author

lysov commented Nov 19, 2021

Would love to provide more information if somebody could point out what's missing.

@bkendall
Copy link
Contributor

The bot is particularly picky, don't worry about that. Someone more familiar with the auth emulator will have to follow up on this.

@leedward
Copy link

leedward commented Nov 8, 2022

I have also come into this issue. Running the latest versions of Firebase and Tools and having the same messages as decribed, this issue being a year old it seems it is not going to be fixed soon.

A work around is easy but the fix should be simple enough too. We should not have to implement work arounds for testing different environments. They should behave in a mirrored fashion.

@lisajian
Copy link
Contributor

Thanks for raising this issue. The fix should be in the next version bump of firebase-tools (i.e. > 11.16.1)! If you're still facing the bug after the next version, please feel free to reopen or file a new issue

@hjaelee01
Copy link

Still facing the same issue here. I'm currently running on firebase-tools v.12.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants