change application controller to look for both username and email
make login form use login instead of email or username, let devise handle
adding attr_accessor to user model did it. login with username or email address works