[js][auth] onAuthStateChange now correctly returns an instance of the User class.
This commit is contained in:
parent
cfd5e2e033
commit
d2a9bb7fa3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user