Open
Description
Many people use the bundle for APIs and one of the things that mobile apps require is a token immediately after registration, but the function grantAccessToken in OAuth2.php returns JSON instead of the token object. I separated the JSON return and token generation functions so that I can request a new token object and include in my registration data.
public function grantAccessToken(Request $request = NULL) {
$token = $this->processAccessTokenRequest($request);
return new Response(json_encode($token), 200, $this->getJsonHeaders());
}
public function processAccessTokenRequest(Request $request = NULL) {
// previous grantAccessToken function content
return $this->createAccessToken($client, $stored['data'], $stored['scope']);
}