Skip to content

Manage an 'account-exists-with-different-credential' AuthFailed exception? #79

Closed Answered by lesnitsky
jeanmatthieud asked this question in Q&A
Discussion options

You must be logged in to vote

You can handle this using AuthStateChangeAction<DifferentSignInMethodsFound>.

AuthStateChangeAction<DifferentSignInMethodsFound>((context, state) {
  final methods = state.methods; // an array of all provider id's associated with the email
  // your custom logic here
});

If you're using SignInScreen, you can pass this actions to actions list.

If you're building more customized UI – wrap your widget tree with FirebaseUIAction:

FirebaseUIActions(
  actions: [
    AuthStateChangeAction<DifferentSignInMethodsFound>(handler),
  ],
  child: yourWidget,
);

There's also showDifferentMethodSignInDialog that will show relevant UI for given providers, so it could be used to handle this scenario.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lesnitsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants