Open nelson6e65 opened 3 years ago
Or
if (!emailIsAlreadyRegistered(email)) {
showAlert('You are not registered yet. Do you want to create an account?')
}
For Facebook, for example, I can just handle the auth/account-exists-with-different-credential
error code from alternative facades, but this does not throw with Google provider if there is an already registered user with an @gmail.com
email; it just gets replaced the credential.
Hi Nelson,
Please, keep in mind that you can do it just accessing the plugin direct with your own Javascript layer.
You can, just copy and paste the code to your App and customize it to your need.
Sorry about, but seems that this behaviour is very specific, we prefer to keep like default by Firebase.
Let me know if you need some help doing this or we can close this issue.
Best regards, Bernardo Baumblatt
Yes, I did it, splitting more the code to with an option to only login in the native layer to perform the check and then login in the JavaScript layer with Firebase, but I was not able to check the user details. 🥺 The result
only gives me the token ID, no more info.
I was wondering if there is a way to access the email info before to perform the Firebase sign-in, but I think this is made internally by Firebase.
I had to workaround.
My real issue was about credentials been replaced by Google, but you only need to verify the email when registering if you are using a direct password. So, the next time user sign-in, if the user uses Google the credential, it will be linked without replacements.
I was wondering if there is a way to access the email info before to perform the Firebase sign-in, but I think this is made internally by Firebase.
If this is not possible 🥺, then you can close this question.
I meant like #23 but before perform the web auth:
So I can do something like this:
https://github.com/baumblatt/capacitor-firebase-auth/blob/73116ce400bf746ed2a5bbe82879ed5b030c6ce6/src/alternative/alternative.ts#L54
I want this because if I login with Google and it's already registered with email/password or Facebook for that email, the is credential replaced (https://stackoverflow.com/a/40768870/7242535).
The credentials are returned, but after sign in (https://github.com/baumblatt/capacitor-firebase-auth/issues/106#issuecomment-675671922) https://github.com/baumblatt/capacitor-firebase-auth/blob/73116ce400bf746ed2a5bbe82879ed5b030c6ce6/src/alternative/alternative.ts#L61