alixandru / q2a-open-login

Question2Answer Open Login plugin
62 stars 44 forks source link

Why is qa_users.email field not set when creating new user? #48

Closed rummt closed 9 years ago

rummt commented 9 years ago

If I create a new user via an external provider the qa_users.email field is left blank. This appears to prevent the user logging in using the regular email/password option.

Manually setting the email field allows the user to login using both options with, apparently, no side-effects.

Have I missed something?

alixandru commented 9 years ago

email field is set to blank if and only if the email is already used by another user account, in order to prevent collision of the 2 users. if email is not used, the the field is properly set.

can you confirm this is the case in your situation?

as a side note, users can anyway change emails from their account page, so this should not be an issue.

rummt commented 9 years ago

Ah, yes, that's exactly what's happened. I'm importing a whole pile of users from a previous app (OSQA) and trying to make sure that if they had previously used openid they'd be able to associate it with the new account.

What was happening was that because bit 0x01 (Email Confirmed) was NOT set a new account was being created with qa_users.email empty. If I set flags = 0x01 they get the option to link to the new account, which works.

I had thought I'd need to set the qa_users.oemail field but that doesn't appear necessary.

Thanks!