Skip to content

Commit 545091a

Browse files
authored
Merge pull request #65 from ADmad/issue-64
Fix default exception class selection.
2 parents 928d80e + 6cd1155 commit 545091a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Auth/JwtAuthenticate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function __construct(ComponentRegistry $registry, $config)
9898
'key' => null,
9999
];
100100

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

tests/TestCase/Auth/JwtAuthenticateTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public function testUnauthenticated()
260260
{
261261
$this->Registry->Auth->setConfig('authError', 'Auth error');
262262

263+
$exceptionClass = UnauthorizedException::class;
263264
if (!class_exists(UnauthorizedException::class)) {
264265
$exceptionClass = 'Cake\Network\Exception\UnauthorizedException';
265266
}

0 commit comments

Comments
 (0)