A search of Stackoverflow.com gave me this question / answer: Custom authentication strategy for development
Basically, you should implement your own authentication strategy at the Warden level (which is the foundation of Devise). For my project, I did the following:
In config/initializers/devise.rb :
Devise.setup do |config| config.warden do |manager| manager.default_strategies(:scope => :user).unshift :user_has_login_access end end Warden::Strategies.add(:user_has_login_access) do def valid?
You can read more about Warden custom strategies here: https://github.com/hassox/warden/wiki/Strategies
Hope this helps!
neezer
source share