From d2a9bb7fa3d89343443411af42e88c734587d87e Mon Sep 17 00:00:00 2001 From: Salakar Date: Fri, 7 Apr 2017 16:10:04 +0100 Subject: [PATCH] [js][auth] onAuthStateChange now correctly returns an instance of the User class. --- lib/modules/auth/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index b04cd89a..52b7a4af 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -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; }