[auth][ios] Reload the user when unlinking an account to ensure that it’s up to date

This commit is contained in:
Chris Bianca 2017-10-20 17:37:59 +01:00
parent fec365f059
commit 4e66443c71
1 changed files with 9 additions and 1 deletions

View File

@ -794,7 +794,15 @@ RCT_EXPORT_METHOD(unlink:
if (error) { if (error) {
[self promiseRejectAuthException:reject error:error]; [self promiseRejectAuthException:reject error:error];
} else { } else {
[self promiseWithUser:resolve rejecter:reject user:_user]; // This is here to protect against bugs in the iOS SDK which don't
// correctly refresh the user object when unlinking certain accounts
[user reloadWithCompletion:^(NSError * _Nullable error) {
if (error) {
[self promiseRejectAuthException:reject error:error];
} else {
[self promiseWithUser:resolve rejecter:reject user:user];
}
}];
} }
}]; }];
} else { } else {