Open maletor opened 4 years ago
hello Maletor I have the same problem. did you find a way to make the app work?
Hello, Try to put this inside the button code:
try Auth.auth().signOut() navigationController?.popToRootViewControler(animated: true)
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
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.
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.