From 7cc7d5afe52794ff76371234e615a5be39828897 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Thu, 26 Apr 2018 09:21:10 +0100 Subject: [PATCH] [auth] Fix possible race condition #980 --- lib/modules/auth/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index b4b697afe0..31da864dd9 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -103,16 +103,16 @@ export default class Auth extends ModuleBase { } _setUser(user: ?NativeUser): ?User { - this._authResult = true; this._user = user ? new User(this, user) : null; + this._authResult = true; SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user); return this._user; } _setUserCredential(userCredential: NativeUserCredential): UserCredential { const user = new User(this, userCredential.user); - this._authResult = true; this._user = user; + this._authResult = true; SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user); return { additionalUserInfo: userCredential.additionalUserInfo,