Skip to content

Commit 8e10faa

Browse files
committed
Addressing comments
1 parent 4a93a4a commit 8e10faa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Filters/TokenAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function before(RequestInterface $request, $arguments = null)
5050

5151
if (! $result->isOK() || (! empty($arguments) && $result->extraInfo()->tokenCant($arguments[0]))) {
5252
return service('response')
53-
->setStatusCode(Response::HTTP_FORBIDDEN)
53+
->setStatusCode(Response::HTTP_UNAUTHORIZED)
5454
->setJson(['message' => lang('Auth.badToken')]);
5555
}
5656

tests/Authentication/Filters/TokenFilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testFilterNotAuthorized(): void
2424
{
2525
$result = $this->call('get', 'protected-route');
2626

27-
$result->assertStatus(403);
27+
$result->assertStatus(401);
2828

2929
$result = $this->get('open-route');
3030
$result->assertStatus(200);
@@ -84,7 +84,7 @@ public function testFiltersProtectsWithScopes(): void
8484
$result = $this->withHeaders(['Authorization' => 'Bearer ' . $token2->raw_token])
8585
->get('protected-user-route');
8686

87-
$result->assertStatus(403);
87+
$result->assertStatus(401);
8888
}
8989

9090
public function testBlocksInactiveUsers(): void

0 commit comments

Comments
 (0)