Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void onMethodCall(MethodCall call, Result result) {
handleReauthenticateWithCredential(call, result, getAuth(call));
break;
case "linkWithCredential":
handleLinkWithEmailAndPassword(call, result, getAuth(call));
handleLinkWithCredential(call, result, getAuth(call));
break;
case "unlinkFromProvider":
handleUnlinkFromProvider(call, result, getAuth(call));
Expand Down Expand Up @@ -263,6 +263,14 @@ private Map<String, Object> getVerifyPhoneNumberExceptionMap(FirebaseException e
return exceptionMap;
}

private void handleLinkWithCredential(MethodCall call, Result result, FirebaseAuth firebaseAuth) {
AuthCredential credential = getCredential((Map<String, Object>) call.arguments());
firebaseAuth
.getCurrentUser()
.linkWithCredential(credential)
.addOnCompleteListener(new SignInCompleteListener(result));
}

private void handleLinkWithEmailAndPassword(
MethodCall call, Result result, FirebaseAuth firebaseAuth) {
Map<String, String> arguments = call.arguments();
Expand Down