#145 Make login-by-email works correctly