In this case, I prefer monkey-patch Devise::Strategies::Authenticatable instead of expanding the entire repository to create a single line.
Devise::Strategies::Authenticatable.class_eval do private def valid_password? true end end
Just put it in the initializer file or at the end of the devise.rb initializer (I prefer this because it looks a bit like an extra configuration).
To explain valid_password? corrected here valid_password? usually returns password.present? and it is used by Devise::Strategies::DatabaseAuthenticatable as an initial password check before actually checking it against the database. Therefore, this will change the behavior when a password is not provided.
DISCLAIMER: This still works for me, but not fully tested, so use at your own risk.
zelanix
source share