422 when signing in from unlinked 3rd party account

Summary

Users get a 422 when trying to sign in with an unlinked 3rd party account.

Steps to reproduce

  1. Make sure you use a GitHub and Google account with the same email address and neither of them have been used to sign in to GitLab.com before
  2. Sigin in to GitHub
  3. Sign in to GitLab.com using GitHub
  4. Sign out of GitHub and GitLab.com
  5. Sign in to Google
  6. Sign in to GitLab.com with Google

Expected behavior

GitLab should sign me in to the same account, because it is the same email address.

Or if there is a security concern around just signing a user in, a user should be told that they first need to log in through an existing linked account or GitLab.com email address, and then link more accounts.

Actual behavior

It gives a 422, a user would have to look at the URL bar to see that the email has already been taken.

Relevant logs and/or screenshots

email-taken-422

/cc @awhildy