[dancer-users] Dancer2::Plugin::Auth::Extensible wrong login page

Jeff Boes jeff at endpoint.com
Wed Aug 19 14:35:03 BST 2015

I am using the ::Provider::Config setup, with very little customization 
(for now; the plan is to move to a ::Database or ::DBIC provider 

I have a route that looks like this:

get '/locale/:param' =>  require_any_role [qw( admin editor voter )] => 
sub {

My application is running under Plack via:

builder {
     mount '/'    => Qbank::App->to_app;
     mount '/api' => Qbank::API->to_app;

So when I visit /locale/foo, I expect it to redirect me to /login. What 
I see in the logs is:

looking for get /login in 
l. 1180
Entering hook core.app.before_request in (eval 63) l. 1
Failed to serialize the request: hash- or arrayref expected (not a 
simple scalar, use allow_nonref to allow this) at 
line 34. in (eval 264) l. 1
Entering hook core.app.after_request in (eval 63) l. 1
"GET /api/login?return_url=%2Fapi%2Flocale%2Fexam_types HTTP/1.1" ...

I.e., it's prefixing the desired login page URL "/login" with the 
current URL's "/api".

If I hit "/login" directly, it's fine.

Jeff Boes <><
jeff at endpoint.com
(269) 408-0811

More information about the dancer-users mailing list