diff --git a/src/TokenType/AbstractTokenType.php b/src/TokenType/AbstractTokenType.php index addba71f..c106b546 100644 --- a/src/TokenType/AbstractTokenType.php +++ b/src/TokenType/AbstractTokenType.php @@ -43,7 +43,7 @@ abstract class AbstractTokenType /** * Determine the access token in the authorization header - * @param \Symfony\Component\HttpFoundation\Request $request + * @param \Symfony\Component\HttpFoundation\Request $request * @return string */ abstract public function determineAccessTokenInHeader(Request $request); diff --git a/src/TokenType/Bearer.php b/src/TokenType/Bearer.php index dcacf2fc..3cdfc81f 100644 --- a/src/TokenType/Bearer.php +++ b/src/TokenType/Bearer.php @@ -41,6 +41,7 @@ class Bearer extends AbstractTokenType implements TokenTypeInterface { $header = $request->headers->get('Authorization'); $accessToken = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $header)); + return ($accessToken === 'Bearer') ? '' : $accessToken; } }