Closed aliexalter closed 2 months ago
I'm not sure if I understand your problem. As you can see in your screenshot, the code is returned from the plugin. Just access it using "error.code".
In log where it says My FB error it's showing as string not an object how can I access error.code
In log where it says My FB error it's showing as string not an object how can I access error.code
You have catched the error now use in the catch the error.code
and gotcha ;)
I close this issue as the code is already provided by the plugin.
Plugin(s)
Version
6.1.0
Platform(s)
Current behavior
If user is logged in before with Google Sign In the firebase creates a user. After if user login using facebook sign I, it gives following error.
Error: An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.
code: account-exists-with-different-credential
I am using try - catch to fetch the errors as below
Problem here is under error I cannot get code, where code is only shown in plugin error (that is i think native level).
Expected behavior
It should allow to get error.code so by checking the code the user auth is linked to another provider.
If there is any other solution to this problem please guide.
Reproduction
just create new ionic app and add firebase authentication with login buttons as signIn google and signIn facebook
Steps to reproduce
Create an ionic angular capacitor app Install Capacitor FirebaseAuthentication plugin Create login page add two buttons (facebook and google sign in) first sign in using google then sign in with facebook.
Other information
No response
Capacitor doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 6.1.2 @capacitor/core: 6.1.2 @capacitor/android: 6.1.2 @capacitor/ios: 6.1.2
Installed Dependencies:
@capacitor/cli: 6.1.2 @capacitor/core: 6.1.2 @capacitor/android: 6.1.2 @capacitor/ios: 6.1.2
[success] iOS looking great! 👌 [success] Android looking great! 👌
Before submitting