Skip to content

Commit

Permalink
Allow login prompts to display when debug mode is enabled. See #105
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyvercher committed Feb 12, 2020
1 parent 80dbc96 commit a2415c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Provider/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Cedaro\WP\Plugin\AbstractHookProvider;
use Psr\Container\ContainerInterface;
use SatisPress\Exception\AuthenticationException;
use SatisPress\HTTP\Request;
use SatisPress\HTTP\Response;
use SatisPress\Route\Route;
Expand Down Expand Up @@ -89,7 +90,9 @@ public function dispatch( WP $wp ) {
$response = $controller->handle( $this->request );
}
} catch ( \Exception $e ) {
if ( $this->is_debug_mode() ) {
// Don't throw authentication exceptions in debug mode so challenge
// headers can be sent to display login prompts.
if ( $this->is_debug_mode() && ! $e instanceof AuthenticationException ) {
throw $e;
}

Expand Down

0 comments on commit a2415c7

Please sign in to comment.