Add request object back as parameter to the error handler. ``` $app->add(new Tuupola\Middleware\HttpBasicAuthentication([ "error" => function ($request, $response, $arguments) { ... } ])); ``` See https://github.com/tuupola/branca-middleware/pull/13 for reference.