[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 {
|
_setUser(user: ?NativeUser): ?User {
|
||||||
this._authResult = true;
|
|
||||||
this._user = user ? new User(this, user) : null;
|
this._user = user ? new User(this, user) : null;
|
||||||
|
this._authResult = true;
|
||||||
SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user);
|
SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user);
|
||||||
return this._user;
|
return this._user;
|
||||||
}
|
}
|
||||||
|
|
||||||
_setUserCredential(userCredential: NativeUserCredential): UserCredential {
|
_setUserCredential(userCredential: NativeUserCredential): UserCredential {
|
||||||
const user = new User(this, userCredential.user);
|
const user = new User(this, userCredential.user);
|
||||||
this._authResult = true;
|
|
||||||
this._user = user;
|
this._user = user;
|
||||||
|
this._authResult = true;
|
||||||
SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user);
|
SharedEventEmitter.emit(getAppEventName(this, 'onUserChanged'), this._user);
|
||||||
return {
|
return {
|
||||||
additionalUserInfo: userCredential.additionalUserInfo,
|
additionalUserInfo: userCredential.additionalUserInfo,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user