Commits

Toby Inkster committed e916a7c

improve hooks for subclassing

Comments (0)

Files changed (1)

lib/Plack/Middleware/Auth/WebID.pm

 	my $cert  = $env->{ $self->certificate_env_key }
 		or return $self->$unauth($env);
 	
-	my ($webid, $was_cached) = $self->_get_webid($cert);
+	my ($webid, $was_cached) = $self->_get_webid($cert, $env);
 	
 	if ($webid->valid)
 	{
 		$env->{WEBID_OBJECT}    = $webid unless $self->no_object_please;
 		$env->{WEBID_CACHE_HIT} = $was_cached;
 		
-		return $self->app->($env);
+		return $self->_run_app($env);
 	}
 	
 	return $self->$unauth($env);
 }
 
+sub _run_app
+{
+	my ($self, $env) = @_;
+	my $app = $self->app;
+	@_ = $env;
+	goto $app;
+}
+
 sub _get_webid
 {
 	my ($self, $cert) = @_;