module DeviseTokenAuth::Concerns::MongoidSupport

def as_json(options = {})

def as_json(options = {})
  options[:except] = (options[:except] || []) + [:_id]
  hash = super(options)
  hash['id'] = to_param
  hash
end

def dta_find_by(attrs = {})

It's abstract replacement .find_by
def dta_find_by(attrs = {})
  find_by(attrs)
rescue Mongoid::Errors::DocumentNotFound
  nil
end