不使用email登陸:bash
#config/initializers/devise.rb config.authentication_keys = [:username] 複製代碼
rails > 5.1spa
# user.rb def will_save_change_to_email? false end 複製代碼
rails < 5.1code
#user.rb def email_changed? false end 複製代碼