[auth] Fix possible race condition #980
This commit is contained in:
parent
9914dd1ea4
commit
7cc7d5afe5
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue