diff --git a/src/getjump/Vk/Auth.php b/src/getjump/Vk/Auth.php index 084e399..c1cdbc7 100644 --- a/src/getjump/Vk/Auth.php +++ b/src/getjump/Vk/Auth.php @@ -164,8 +164,7 @@ public function getToken($code) $data = $this->guzzle->get($uri)->json(['object' => true]); if (isset($data->access_token)) { - // POSSIBLY WE SHOULD RETURN OBJECT, WITH USER_ID AND EXPIRES IN, NOT ONLY TOKEN - return $data->access_token; + return new \getjump\Vk\Response\Auth($data->access_token, $data->expires_in, $data->user_id); } elseif (isset($data->error)) { // ERROR PROCESSING } diff --git a/src/getjump/Vk/Response/Auth.php b/src/getjump/Vk/Response/Auth.php new file mode 100644 index 0000000..6b6a3c3 --- /dev/null +++ b/src/getjump/Vk/Response/Auth.php @@ -0,0 +1,18 @@ +token = $token; + $this->expiresIn = $expiresIn; + $this->userId = $userId; + } +} \ No newline at end of file