Skip to content

Commit

Permalink
Merge pull request #65 from ADmad/issue-64
Browse files Browse the repository at this point in the history
Fix default exception class selection.
  • Loading branch information
ADmad authored Apr 19, 2018
2 parents 928d80e + 6cd1155 commit 545091a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Auth/JwtAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function __construct(ComponentRegistry $registry, $config)
'key' => null,
];

if (!class_exists(UnauthorizedException::class, false)) {
if (!class_exists(UnauthorizedException::class)) {
$defaultConfig['unauthenticatedException'] = 'Cake\Network\Exception\UnauthorizedException';
}

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Auth/JwtAuthenticateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public function testUnauthenticated()
{
$this->Registry->Auth->setConfig('authError', 'Auth error');

$exceptionClass = UnauthorizedException::class;
if (!class_exists(UnauthorizedException::class)) {
$exceptionClass = 'Cake\Network\Exception\UnauthorizedException';
}
Expand Down

0 comments on commit 545091a

Please sign in to comment.