Skip to content

Commit

Permalink
fix(parameter): Request parameter backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
R2c committed Oct 8, 2020
1 parent 7b0ab6f commit 7b6a62a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Request/RequestRefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ public static function getRefreshToken(Request $request, $tokenParameterName)
if (false !== strpos($request->getContentType(), 'json')) {
$content = $request->getContent();
$params = !empty($content) ? json_decode($content, true) : array();
$refreshTokenString = isset($params[$tokenParameterName]) ? trim($params[$tokenParameterName]) : null;
$refreshTokenString = $params[$tokenParameterName] ?? $params['refresh_token'] ?? null;
dump($refreshTokenString);
} elseif (null !== $request->get($tokenParameterName)) {
$refreshTokenString = $request->get($tokenParameterName);
} elseif (null !== $request->get('refresh_token')) {
$refreshTokenString = $request->get('refresh_token');
}

return $refreshTokenString;
Expand Down

0 comments on commit 7b6a62a

Please sign in to comment.