We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9c7599 commit bd438b4Copy full SHA for bd438b4
src/FirebaseAuth.jsx
@@ -63,6 +63,15 @@ export default class FirebaseAuth extends React.Component {
63
this.firebaseUiWidget.reset();
64
}
65
66
+ // We track the auth state to reset firebaseUi if the user signs out.
67
+ this.userSignedIn = false;
68
+ this.unregisterAuthObserver = this.firebaseAuth.onAuthStateChanged((user) => {
69
+ if (!user && this.userSignedIn) {
70
+ this.firebaseUiWidget.reset();
71
+ }
72
+ this.userSignedIn = !!user;
73
+ });
74
+
75
// Trigger the callback if any was set.
76
if (this.uiCallback) {
77
this.uiCallback(this.firebaseUiWidget);
0 commit comments