I looked into this. It isn't difficult to fix by looking into superclasses:
diff --git a/lib/rodauth/features/internal_request.rb b/lib/rodauth/features/internal_request.rb
index 85745b9..2b51a99 100644
--- a/lib/rodauth/features/internal_request.rb
+++ b/lib/rodauth/features/internal_request.rb
@@ -384,16 +384,26 @@ module Rodauth
return if is_a?(InternalRequestMethods)
+ superklasses = []
+ superklass = self.class
+ until superklass == Rodauth::Auth
+ superklasses << superklass
+ superklass = superklass.superclass
+ end
+
klass = self.class
internal_class = Class.new(klass)
internal_class.instance_variable_set(:@configuration_name, klass.configuration_name)
+ configuration = internal_class.configuration
- if blocks = klass.instance_variable_get(:@internal_request_configuration_blocks)
- configuration = internal_class.configuration
- blocks.each do |block|
- configuration.instance_exec(&block)
+ superklasses.reverse_each do |superklass|
+ if blocks = superklass.instance_variable_get(:@internal_request_configuration_blocks)
+ blocks.each do |block|
+ configuration.instance_exec(&block)
+ end
end
end
However, be aware that this doesn't result in passing the spec in your pull request, because for auth1, the internal request configuration from the superclass overrides the regular configuration from the subclass. Internal request classes are always subclasses of the current class, and not subclasses of an internal request class for a superclass. The internal request creation will now process all internal request configuration blocks in serial starting with the first superclass block. So use of super inside internal request methods will not call the implementation in the superclass's internal request class.