2
0
mirror of synced 2025-01-11 14:44:12 +00:00

[js][auth] onAuthStateChange now correctly returns an instance of the User class.

This commit is contained in:
Salakar 2017-04-07 16:10:04 +01:00
parent cfd5e2e033
commit d2a9bb7fa3

View File

@ -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;
}