Allow email as username during login

See #1827