The solution I provided above doesn’t work either. The provider absolutely does not care that a user with such a login already exists.
I’m shocked. Terrible behaviour.
This behavior renders this feature useless. this poses a risk of crashing the application
In the screenshot below, one user was created using standard registration, the second - by the provider
If you first create an account using the Google provider, and then try to use the same mail with standard registration, then everything is fine. Strapi will refuse, since there is already a record with such mail, but the provider ignores these rules, which means that if we first create an account using standard means, and then authorize the provider’s Google with the same mail, we will get a new account with the same login and mail.
This is very, very wrong.