Closed janko closed 2 years ago
Looks like this works mostly by accident and not by design now, and might still result in the route being available at /
instead of /create-account
(didn't test that, but that's how it appears to work). At the very least, we'd want to make sure we had tests for this behavior, and it would be a good idea to make it deliberate in the code. I'm guessing the best way to make it deliberate would be to change post_configure
to not add the route to the route_hash if the route method returns nil
/false
. Is that something you feel comfortable working on?
Makes total sense 👍🏻. I updated the code to avoid storing /
into the route hash, tested that both nil
and false
can be set, and that internal requests still work.
There are use cases where it makes sense to want to disable certain routes (see https://github.com/janko/rodauth-rails/discussions/110). It appears that setting the
*_route
method tonil
works, while still keeping the internal request functionality intact. If you agree, I thought it would be useful to have it documented in an official guide.