[auth] Fix possible race condition #980

This commit is contained in:
Chris Bianca 2018-04-26 09:21:10 +01:00
parent 9914dd1ea4
commit 7cc7d5afe5
1 changed files with 2 additions and 2 deletions

View File

@ -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,