1

I tried to override Lockable module to support in devise-token-auth but it is not overriding. I searched on everywhere and found nothing. I think I missed something but I don't know what. Any help would be appreciated

module Lockable extends Devise::Models::Lockable

  def valid_for_authentication?
    # My code 
  end

end
Dhurba Baral
  • 559
  • 5
  • 12

1 Answers1

4

Drop that extends and include the module in your devise model (User, is it?)

module MyLockable
  def valid_for_authentication? # or whatever
    ...
  end
end

class User
  include MyLockable
end

Or you can simply define that method in the user directly.

class User
  def valid_for_authentication?
    ...
  end
end
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367