Open rawleyfowler opened 10 months ago
Might be an idea to provide a full copiable Lite app example.
I never use requires
like that. I do something similar to
my $auth = $router->under('/')->requires( authenticated => 1);
$auth -> get('/')->->to('app#index')->name('index');
note sure if that makes a difference.
@daleif Thats not very ergonomic if I need more than 1 condition
$self->routes->add_condition( authenticated => \&authenticated );
Seems to fix this.
Instead of:
$routes->add_condition( authenticated => \&authenticated );
Steps to reproduce the behavior
Expected behavior
I expect that adding the authenticated condition to
/
will not cause it to be added to/login
.Actual behavior
authenticated
is added to both routes. Causing a redirect loop when accessing/
, or/login
.If, however I move the order of the routes around, it works as expected.
Thanks.