mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
[js][auth] onAuthStateChange now correctly returns an instance of the User class.
This commit is contained in:
@@ -42,12 +42,7 @@ export default class Auth extends Base {
|
||||
if (auth && auth.user && !this._user) this._user = new User(this, auth);
|
||||
else if ((!auth || !auth.user) && this._user) this._user = null;
|
||||
else if (this._user) this._user._updateValues(auth);
|
||||
if (emit) {
|
||||
this.emit(
|
||||
'onAuthStateChanged',
|
||||
this._authResult && this._authResult.user || null
|
||||
);
|
||||
}
|
||||
if (emit) this.emit('onAuthStateChanged', this._user);
|
||||
return auth ? this._user : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user