firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.44k stars 3.91k forks source link

FirebaseAuth.instance.currentUser always null on windows app flutter !! #12734

Closed Hmida71 closed 5 days ago

Hmida71 commented 2 weeks ago

Is there an existing issue for this?

Which plugins are affected?

Core, Auth

Which platforms are affected?

Windows

Description

FirebaseAuth.instance.currentUser always null on windows app flutter ?

Reproducing the issue

I am seeing this issue too on Windows. After I sign in/email-pass sign in, hot restarting the app returns currentUser as null. This also happens on subsequent app runs too.

In my case, it is always null, even after few seconds. I tried this:

FirebaseAuth.instance.authStateChanges().listen((event) {
      print('Auth state changed: $event');
});
and this : 
final userGoogle = FirebaseAuth.instance.currentUser;
    print(userGoogle);
    if (userGoogle == null) {
      isLogin = false;
    } else {
      isLogin = true;
    }

and it only prints null and never prints again. ??

Firebase Core version

2.30.0

Flutter Version

3.19.5

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```

Additional context and comments

No response

TarekkMA commented 2 weeks ago

@Hmida71 Thank you for reporting this issue.

Can you try this on andoird or ios and see if you have the same issue?

Hmida71 commented 2 weeks ago

@Hmida71 Thank you for reporting this issue.

Can you try this on andoird or ios and see if you have the same issue?

No just on Desktop apps

russellwheatley commented 5 days ago

This is a duplicate of this issue: https://github.com/firebase/flutterfire/issues/12055

closing out in favour of tracking there