Hi Jeremy,
I've recently completed the weeks-long project of moving our app from Devise to Rodauth. So far, pretty seamless! I have some notes and hope to write a blog post as well as publish a lot of the custom features I wrote for the integration, but will depend on time!
One thing that came up, in the context of rodauth-rails, is that there is no good way (i.e. that isn't brittle) to participate in Rails' own action hooks. This is chiefly because Rails' hook code is quite complicated and works by taking the action to run as a block-parameter but Rodauth has no `around_rodauth`.
To discuss possibilities, I've taken the liberty of whipping up a proof-of-concept of what `around` hooks might look like in Rodauth and implemented the hook for the Base feature (`around_rodauth`) based on some back-and-forth with Janko.
The idea would be that rodauth-rails could then do something like:
def around_rodauth
rails_controller_instance.run_callbacks(:process_action) do
# TBD: handle potential response from Rails `before_action` here
yield
end
end
In my actual PoC, I was undecided as to whether `around 'feature'` should also define `before 'feature'` and `after 'feature'` and even whether it should own calling those hooks (so one might only use `around_feature { the_action }` and have all three hooks covered). Presently, I opted not to define them, but to call them if they have been defined.
There is obviously some consideration to be had here around whether `after_<feature>` should be run unconditionally, or only when no failure has happened.
If you are generally supportive of moving in this direction for the benefit of an improved rodauth-rails experience, then the specifics can be ironed out with your design guidance.
Cheers,
Bo