Description
In some slight edge cases it could be that a user attempts to register twice with the same GitHub account. Normally this is handled by a query to retrieve a user so they're just authenticated instead of being presented the registration screen. I'm not entirely sure how this happens but we should look into how to prevent users from attempting to register twice with the same GitHub ID.
Atm there isn't a check here for a duplicate GitHub ID. However I think there shouldn't be one. Instead, we should check inside the create
method of the RegisterController
to see if we can already find a model with it. If we can, we should present them with a view that says:
We already found a user with the given GitHub account (link to it). Would you like to login instead?
And then show the same GitHub login button as on the login page.