diff --git a/lib/classes/API/OAuth2/Adapter.class.php b/lib/classes/API/OAuth2/Adapter.class.php index d1af88278e..7d61431173 100644 --- a/lib/classes/API/OAuth2/Adapter.class.php +++ b/lib/classes/API/OAuth2/Adapter.class.php @@ -597,8 +597,8 @@ class API_OAuth2_Adapter extends OAuth2 } else { - if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_AUTH_CODE || $response_type == OAUTH2_AUTH_RESPONSE_TYPE_CODE_AND_TOKEN) - $result["token"] = $this->createAccessToken($account_id, $scope); + if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_AUTH_CODE) + $result["code"] = $this->createAuthCode($account_id, $redirect_uri, $scope); if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_ACCESS_TOKEN) $result["error"] = OAUTH2_ERROR_UNSUPPORTED_RESPONSE_TYPE; diff --git a/templates/web/api/auth/native_app_access_token.twig b/templates/web/api/auth/native_app_access_token.twig index 9b438febf4..d16b7c5677 100644 --- a/templates/web/api/auth/native_app_access_token.twig +++ b/templates/web/api/auth/native_app_access_token.twig @@ -58,7 +58,7 @@ {{error}} {% endtrans %}
- + {% else %}