Fix email logins on front-end.

Also add user type to User model.
Merge pull request #352 from benkonrath/fix-email-logins-on-front-end

Fix email logins on front-end.