* @return void
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
- // Run the pre filters
- $this->executePreFilters($requestInstance, $responseInstance);
+ // Try to run the pre filters, if auth exceptions come through redirect here
+ try {
+ // Run the pre filters
+ $this->executePreFilters($requestInstance, $responseInstance);
+ } catch (UserAuthorizationException $e) {
+ // Redirect to main page
+ $responseInstance->redirectToConfiguredUrl('login_failed_url');
+ }
// Get the command instance from the resolver by sending a request instance to the resolver
$commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);