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

auth emulator creates a user with empty strings for email and password, using createUserWithEmailAndPassword #5639

Closed
isbogdanov opened this issue Mar 30, 2023 · 2 comments

Comments

@isbogdanov
Copy link

isbogdanov commented Mar 30, 2023

[REQUIRED] Environment info

firebase-tools: 11.25.1

**Platform:**mac os, nmp

[REQUIRED] Test case

Auth emulator creates a user with empty email and password.

      const email = ""; 
      const password = ""; 
      await createUserWithEmailAndPassword(auth, email, password)
        .then((user) => {
          console.log("Registered and logged in:", user);
        })
        .catch((error) => {console.log(error)}

[REQUIRED] Steps to reproduce

Passing empty strings to createUserWithEmailAndPassword results in account creation and signing in with the created user credentials, even though credentials lack. Basically it resembles anonymous login, but the created and signed in current user is not anonymous (isAnonymous: false) despite the fact that all object fields except for uid are empty.

At the same time deployed version does not allow for empty strings to be passed to createUserWithEmailAndPassword. Doing so results in error "auth/invalid-email"

[REQUIRED] Expected behavior

Expected throwing an error "auth/invalid-email"

[REQUIRED] Actual behavior

Empty account gets created

@aalej
Copy link
Contributor

aalej commented Mar 31, 2023

Hi @isbogdanov, thanks for reporting this issue. I was able to replicate the behavior you mentioned. When using the Auth emulator, a user is created with a blank email address. But when connecting to a Firebase project, an error is raised. I’ll notify our team about this so that they can take a look, and I’ll be marking this as reproducible.

@aalej
Copy link
Contributor

aalej commented Sep 22, 2023

Hi, this should be fixed in #5906. That said, I’ll be closing this issue. Feel free to ask this to be reopened if the issue still occurs. Thanks!

@aalej aalej closed this as completed Sep 22, 2023
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

3 participants