Replies: 1 comment 2 replies
-
I think using the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In rodauth-rails, I've configured the Rodauth app to be used as a middleware. The problem is, people sometimes get tripped up about unmatched requests not reaching the Rails router. Let's use this example:
In the example above, any
/auth/*
requests not matched by terminal matchers will not automatically get forwarded to the main app. To address this, I've been recommending using the pass plugin:However, given that the Rodauth documentation cannot show this in every example, people get tripped up by this.
Is there a way rodauth-rails could configure the Roda middleware to automatically exit from matchers that didn't handle the request? Would overriding
block_result_body
to callpass
work, or is that too hacky?What do you think about possibly introducing this functionality into the
middleware
plugin? My idea was to add a plugin option that callsthrow :next
instead ofpass
in the example above? I think that might even be more correct behavior, because it doesn't change how the routing tree works, just forwards unhandled requests.Another idea was for rodauth-rails to use the
not_found
plugin and callthrow :next
. It does feel like it would be relying on internals of the middleware plugin a bit, though.Beta Was this translation helpful? Give feedback.
All reactions