Fixes #6294 : Correct handling of email login
Merge pull request #6316 from gerard-kanters/patch-4

Fixes #6294 : Correct handling of email login before validation