Replies: 2 comments 1 reply
-
This would also help with potential Rodauth features that load Roda plugins. For example, I'm currently working on an OmniAuth integration for Rodauth, and that feature in |
Beta Was this translation helpful? Give feedback.
-
One simple solution for module InternalRequestClassMethods
def roda_class
superclass.roda_class
end
end and drop the setting of the @roda_class instance variable in In terms of changing when |
Beta Was this translation helpful? Give feedback.
-
When testing something in a self-contained script, I noticed that internal_request feature isn't correctly initialized when it's loaded into a named auth class, because at that point the
roda_class
hasn't yet been set, it doesn't get set on the internal subclass inpost_configure
.Loading the internal_request works in the plugin block, as at that point the roda class has already been assigned, so that's definitely an alternative.
In rodauth-rails this is not a problem, because there the
roda_class
is assigned as soon asRodauth::Rails::Auth
(a subclass ofRodauth::Auth
) is subclassed, not only when loading the plugin. I was just considering if this can be addressed in Rodauth somehow, to make internal_request easier to use with named auth classes outside of Rails.An idea I had was to call
post_configure
only in Roda'sconfigure
plugin hook, which ensuresroda_class
will be assigned, instead of inRodauth::Auth.configure
. One hiccup there is that if plugin is initialized without a block and a new auth class,#post_configure
wouldn't exist, as the base feature isn't loaded. But we could probably fix this by disallowing not passing a block if the auth class is not configured.What do you think about this?
Beta Was this translation helpful? Give feedback.
All reactions