Skip to content

[firebase_auth ^0.15.4] <Multiple accounts per email address> #1949

@kingdg25

Description

@kingdg25

Screenshot from 2020-02-07 13-16-56

In firebase authentication Allow creation of multiple accounts with the same email address

  GoogleSignInAccount googleUser = await googleSignIn.signIn();
  print(googleUser.authentication);
  GoogleSignInAuthentication googleAuth = await googleUser.authentication;
  print(googleAuth.idToken);
  final AuthCredential credential = GoogleAuthProvider.getCredential(
    accessToken: googleAuth.accessToken,
    idToken: googleAuth.idToken,
  );
  print(credential);
  FirebaseUser firebaseUser =
  (await firebaseAuth.signInWithCredential(credential)).user;
  print("=====firebaseUser");
  print(firebaseUser);
  print(firebaseUser.email);

After logging in, getting the email(even others functions like displayName, photoUrl) using the FireBaseUser instance(firebase.email) returns null.

here is the output/print:
Screenshot from 2020-02-07 13-32-29

But choosing back the Prevent creation of multiple accounts with the same email address in authentication advance settings:
Screenshot from 2020-02-07 13-25-53

No errors but returning the expected email address.

PS. that email address was used in different provider(like facebook login)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions