mirror of
https://github.com/status-im/react-native-firebase.git
synced 2026-09-01 22:51:09 +00:00
Merge branch 'master' of https://github.com/invertase/react-native-firebase into multi-apps
This commit is contained in:
@@ -719,6 +719,38 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* unlink
|
||||
*
|
||||
* @url https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#unlink(java.lang.String)
|
||||
* @param providerId
|
||||
* @param promise
|
||||
*/
|
||||
@ReactMethod
|
||||
public void unlink(final String providerId, final Promise promise) {
|
||||
FirebaseUser user = mAuth.getCurrentUser();
|
||||
Log.d(TAG, "unlink");
|
||||
|
||||
if (user != null) {
|
||||
user.unlink(providerId)
|
||||
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<AuthResult> task) {
|
||||
if (task.isSuccessful()) {
|
||||
Log.d(TAG, "unlink:onComplete:success");
|
||||
promiseWithUser(task.getResult().getUser(), promise);
|
||||
} else {
|
||||
Exception exception = task.getException();
|
||||
Log.e(TAG, "unlink:onComplete:failure", exception);
|
||||
promiseRejectAuthException(promise, exception);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
promiseNoUser(promise, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* reauthenticate
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user