[auth][android] remove firebase
providerData from user responses, see: https://github.com/firebase/firebase-ios-sdk/issues/140
This commit is contained in:
parent
c4d066fd55
commit
e96c5db8d1
@ -718,9 +718,9 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
|
|||||||
/**
|
/**
|
||||||
* unlink
|
* unlink
|
||||||
*
|
*
|
||||||
* @url https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#unlink(java.lang.String)
|
|
||||||
* @param providerId
|
* @param providerId
|
||||||
* @param promise
|
* @param promise
|
||||||
|
* @url https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#unlink(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void unlink(final String appName, final String providerId, final Promise promise) {
|
public void unlink(final String appName, final String providerId, final Promise promise) {
|
||||||
@ -1010,22 +1010,26 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
|
|||||||
private WritableArray convertProviderData(List<? extends UserInfo> providerData) {
|
private WritableArray convertProviderData(List<? extends UserInfo> providerData) {
|
||||||
WritableArray output = Arguments.createArray();
|
WritableArray output = Arguments.createArray();
|
||||||
for (UserInfo userInfo : providerData) {
|
for (UserInfo userInfo : providerData) {
|
||||||
WritableMap userInfoMap = Arguments.createMap();
|
// remove 'firebase' provider data - android fb sdk
|
||||||
userInfoMap.putString("providerId", userInfo.getProviderId());
|
// should not be returning this as the ios/web ones don't
|
||||||
userInfoMap.putString("uid", userInfo.getUid());
|
if (!userInfo.getProviderId().equals("firebase")) {
|
||||||
userInfoMap.putString("displayName", userInfo.getDisplayName());
|
WritableMap userInfoMap = Arguments.createMap();
|
||||||
|
userInfoMap.putString("providerId", userInfo.getProviderId());
|
||||||
|
userInfoMap.putString("uid", userInfo.getUid());
|
||||||
|
userInfoMap.putString("displayName", userInfo.getDisplayName());
|
||||||
|
|
||||||
final Uri photoUrl = userInfo.getPhotoUrl();
|
final Uri photoUrl = userInfo.getPhotoUrl();
|
||||||
|
|
||||||
if (photoUrl != null) {
|
if (photoUrl != null) {
|
||||||
userInfoMap.putString("photoURL", photoUrl.toString());
|
userInfoMap.putString("photoURL", photoUrl.toString());
|
||||||
} else {
|
} else {
|
||||||
userInfoMap.putNull("photoURL");
|
userInfoMap.putNull("photoURL");
|
||||||
|
}
|
||||||
|
|
||||||
|
userInfoMap.putString("email", userInfo.getEmail());
|
||||||
|
|
||||||
|
output.pushMap(userInfoMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
userInfoMap.putString("email", userInfo.getEmail());
|
|
||||||
|
|
||||||
output.pushMap(userInfoMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user