umbraco / OurUmbraco

MIT License
96 stars 171 forks source link

Login with GitHub fails if member with same email exists #768

Open bjarnef opened 2 years ago

bjarnef commented 2 years ago

Detailed description

On the login page there is the button to login with GitHub. However this seems to fails, because I already have an user on Our.. and because the same email is used on GitHub.

I guess it try to create a user/member if one doesn't already exists on Our?

image

image

rasmusjp commented 2 years ago

Isn't this because you need to link you Our profile with Github by logging in with email/password first?

abjerner commented 2 years ago

Isn't this because you need to link you Our profile with GitHub by logging in with email/password first?

Sounds like a good explanation.

I can see Bjarne has a GitHub link on his profile, but if he did specify his GitHub username prior to my original PR, that could be why (handling that was out of the scope of my PR).

bjarnef commented 2 years ago

It should already be linked to my GitHub account :)

image

abjerner commented 2 years ago

What happens if you unlink and link again?

Again because existing values was out of the scope of my PR, I think Our thinks you have linked your GitHub account even if you entered your username manually at some point. Linking saves some additional information (eg. your GitHub user ID).

If it still doesn't work, maybe Rasmus or someone from HQ can help.

bjarnef commented 2 years ago

@abjerner unlinking and linking to GitHub again seemed to work. After this I got the same error message as mentioned here https://github.com/umbraco/OurUmbraco/issues/770

On second attempt it was very slow, but did then log me in. On subsequent attempts it was faster (I guess it may be cached).

abjerner commented 2 years ago

@bjarnef I don't think the two are related.

Regarding the slow performance and timeout errors, IIRC the login code is looking for the username property on the member, so it's user the member service (database) to find a member with the correct username.

I'd imagine the code takes a bit longer for each new member that is registered, so take 4-5 years of members, it might not perform as well as it did when I made the PR. The overall load of the site might have something to say as well.