Skip to content

Did I understand the user auth().signInWithCredential correctly? #5654

Answered by mikehardy
TommyLeong asked this question in Q&A
Discussion options

You must be logged in to vote

I think what you describe is correct. This is what I do:

  async googleSignIn(link?: boolean): Promise<boolean> {
    try {
      await GoogleSignin.hasPlayServices();
      GoogleSignin.configure({
        webClientId: AppConfig.getGoogleWebClientId(),
        offlineAccess: true,
      });
      const data = await GoogleSignin.signIn();
      console.log('UserStore::googleSignIn - user result is:', JSON.stringify(data, null, 2));

      this.removeUserChangeListener();

      const providers = await this.getProvidersForEmail(data.user.email);
      console.log(
        'UserStore::googleSignIn - got providers for email: ',
        JSON.stringify(providers, null, 2)
      );
      // if …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TommyLeong
Comment options

@mikehardy
Comment options

@TommyLeong
Comment options

@mikehardy
Comment options

Answer selected by TommyLeong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants