Skip to content

Commit b08ad53

Browse files
committed
Check for Authorization header prior to getting token bearer
1 parent 00eda9e commit b08ad53

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Adapter/TokenBearer.php

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public function __construct(UserRepositoryInterface $user_repository, TokenRepos
4747
*/
4848
public function initialize(ServerRequestInterface $request)
4949
{
50+
if (!$request->hasHeader('Authorization')) {
51+
return null;
52+
}
53+
5054
$authorization = $request->getHeaderLine('Authorization');
5155

5256
if (empty($authorization) || substr($authorization, 0, 7) !== 'Bearer ') {

src/Session/RepositoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function recordUsageById($session_id);
5555
public function recordUsageBySession(SessionInterface $session);
5656

5757
/**
58-
* Issue a new token.
58+
* Create a new session.
5959
*
6060
* @param AuthenticatedUserInterface $user
6161
* @param DateTimeInterface|null $expires_at

0 commit comments

Comments
 (0)