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::createUser* return different shape data than Firebase Web SDK #63

Open
brandonpearcy opened this issue Apr 26, 2020 · 0 comments
Open

Comments

@brandonpearcy
Copy link

It seems like firebase-mock may be providing the wrong shape of return data for the suite of createUser* functions (or I'm misusing firebase-mock 😅) The difference is that firebase-mock is returning something that resembles firebase.User or firebase.UserInfo instead of firebase.auth.UserCredential.

I believe it should be returning data shaped like UserCredential, which has the UserInfo nested inside a user member.

Here are the relevant types from Firebase Auth (from the JS SDK).

    createUserWithEmailAndPassword(
      email: string,
      password: string
    ): Promise<firebase.auth.UserCredential>;

...where firebase.auth.UserCredential has the following shape:

  type UserCredential = {
    additionalUserInfo?: firebase.auth.AdditionalUserInfo | null;
    credential: firebase.auth.AuthCredential | null;
    operationType?: string | null;
    user: firebase.User | null;
  };

https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth-types/index.d.ts#L314

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

No branches or pull requests

1 participant