class Rodauth::Feature

def auth_cached_method(meth, iv=:"@#{meth}")

def auth_cached_method(meth, iv=:"@#{meth}")
  umeth = :"_#{meth}"
  define_method(meth) do
    if instance_variable_defined?(iv)
      instance_variable_get(iv)
    else
      instance_variable_set(iv, send(umeth))
    end
  end
  alias_method(meth, meth)
  auth_private_methods(meth)
end