-
Notifications
You must be signed in to change notification settings - Fork 951
Open
Description
Title:
getAccessTokenData() Returns NULL Despite Valid Token Data
Description:
I'm experiencing an issue with the getAccessTokenData()
function where it returns NULL
even when there are valid values in the $token
variable.
Steps to Reproduce:
- Call the
getAccessTokenData()
method with a valid request and response. - Ensure that the token parameter is correctly retrieved and the token exists in the storage.
- Observe that the function returns
NULL
instead of the expected token data.
Expected Behavior:
The function should return the access token data as an array when provided with a valid token.
Actual Behavior:
The function returns NULL
, which prevents further processing.
Code Snippet:
Here’s the relevant part of the code for reference: bshaffer\oauth2-server-php\src\OAuth2\Controller\ResourceController.php
public function getAccessTokenData(RequestInterface $request, ResponseInterface $response)
{
// Existing logic...
if ($token_param = $this->tokenType->getAccessTokenParameter($request, $response)) {
// Check token validity...
return $token; // This should return the token if valid
}
// Additional logic...
return null;
}
Suggested Fix:
In the updated version of the function, ensure that the return statement at the end is modified to return $token ?? null;
to correctly handle the case when the token is valid.
Please let me know if you need any additional information or further assistance!
Metadata
Metadata
Assignees
Labels
No labels