Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Handle sign in failure #48

Open
abraham opened this issue Dec 18, 2018 · 4 comments
Open

Handle sign in failure #48

abraham opened this issue Dec 18, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@abraham
Copy link
Owner

abraham commented Dec 18, 2018

In Auth#signInWithGoogle, handle googleSignIn.signIn returning null, or a user clicking cancel (and any other likely to happen failures). If a failure happens then the users should probably be shown an error snackbar.

Related #49.

Methods that are likely to fail:

Relevant file: https://github.com/abraham/birb/pull/44/files#diff-122192ef8946fb1a2ce64cd05629c825R16

@abraham abraham added enhancement New feature or request help wanted Extra attention is needed labels Dec 18, 2018
@thisroot
Copy link

Hi, i was try to you app, and got the this error. I have one question. Must i had registered user into my firebase or this method make registering users?

@abraham
Copy link
Owner Author

abraham commented Dec 21, 2018

@thisroot There shouldn't be anything needed to specifically register users in Firebase. Make sure you have followed the Firebase configuration setup steps though: Android / iOS. If sign in still doesn't work, please open a new issue.

@geminiyellow
Copy link

hi @abraham , signInWithGoogle is gone,

ref: flutter/flutter#27133 (comment)

we can use it like this:

  Future<String> _testSignInWithGoogle() async {
    final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
    final GoogleSignInAuthentication googleAuth =
        await googleUser.authentication;
    final AuthCredential credential = GoogleAuthProvider.getCredential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );
    final FirebaseUser user = await _auth.signInWithCredential(credential);
    assert(user.email != null);
    assert(user.displayName != null);
    assert(!user.isAnonymous);
    assert(await user.getIdToken() != null);

    final FirebaseUser currentUser = await _auth.currentUser();
    assert(user.uid == currentUser.uid);

    return 'signInWithGoogle succeeded: $user';
  }

@abraham
Copy link
Owner Author

abraham commented Jun 9, 2019

@geminiyellow Thanks for the notice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants