I have two devise models: User and Member
As such, I’m specifying authentication keys on the models themselves instead of in the Devise initializer.
Member.rb
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :authentication_keys => [:email, :subdomain]
I also override
def self.find_for_authentication(conditions={})
debugger
conditions[:account_id] = Account.find_by_subdomain(conditions.delete(:subdomain)).id
super(conditions)
end
Unfortunately, when authentication_keys has multiple keys, my find_for_authentication method doesn’t appear to be firing. Works fine when I specify just one key. Any thoughts?
subdomain should have been a request_key since it’s part of the request.