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

Infinte loading for user that's logged out. #13

Open
maletor opened this issue Feb 2, 2020 · 4 comments
Open

Infinte loading for user that's logged out. #13

maletor opened this issue Feb 2, 2020 · 4 comments

Comments

@maletor
Copy link

maletor commented Feb 2, 2020

In https://github.com/fireship-io/flutter-firebase-quizapp-course/blob/master/lib/screens/profile.dart

if the user logs out, out of band, like by resetting their password, and they are logged into the app, they'll get an infinite loading screen.

@alariad
Copy link

alariad commented Apr 23, 2020

hello Maletor I have the same problem.
did you find a way to make the app work?

@JeanLuizds
Copy link

Hello, Try to put this inside the button code:

try Auth.auth().signOut()
navigationController?.popToRootViewControler(animated: true)

@Joshfindit
Copy link

I added this
var user = FirebaseAuth.instance.currentUser;

And this to class AuthService:

Future<void> signOut() async {
    try {
      await FirebaseAuth.instance.signOut();
    } on FirebaseAuthException catch (e) {
      // Force signout anyways
      user = null;
    }
  }
}

This to Future<void> googleLogin() async {

    } on FirebaseAuthException catch (e) {
      // handle error
      user = null;
    }

Not elegant, but this course is my first dive in to Flutter and local Firebase auth

@Joshfindit
Copy link

I also feel like the right option is in watching the auth stream for changes and logging the user out in response, but that's above my current knowledge.

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

4 participants