From eaa4a0382832c057570303e7d413dcf3bb64c422 Mon Sep 17 00:00:00 2001 From: Boris Talovikov Date: Wed, 14 May 2025 20:53:25 +0500 Subject: [PATCH] User: fixed example, fixed token parameters. Token request works correctly now. --- .gitignore | 1 + README.md | 0 composer.json | 0 examples/oauth/user.php | 5 +++-- phpunit.xml | 0 src/VK/OAuth/User/DTO/TokensParams.php | 4 ++-- 6 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .gitignore mode change 100755 => 100644 README.md mode change 100755 => 100644 composer.json mode change 100755 => 100644 phpunit.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3ed10e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.cache diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/examples/oauth/user.php b/examples/oauth/user.php index ab466ec..7c3cdb4 100644 --- a/examples/oauth/user.php +++ b/examples/oauth/user.php @@ -1,6 +1,7 @@ setScope([Scopes::EMAIL, Scopes::PHONE]); +))->setScopes([Scopes::EMAIL, Scopes::PHONE]); $authUrl = $auth->getAuthorizeUrl($authParams); @@ -31,7 +32,7 @@ echo "4. Paste this option below\n\n"; echo 'url > '; -$handle = fopen ('php://stdin','r'); +$handle = fopen('php://stdin', 'r'); $url = fgets($handle); fclose($handle); diff --git a/phpunit.xml b/phpunit.xml old mode 100755 new mode 100644 diff --git a/src/VK/OAuth/User/DTO/TokensParams.php b/src/VK/OAuth/User/DTO/TokensParams.php index 15fcf65..95de491 100644 --- a/src/VK/OAuth/User/DTO/TokensParams.php +++ b/src/VK/OAuth/User/DTO/TokensParams.php @@ -1,6 +1,6 @@ client_id = $client_id; - $this->code_verifier = rtrim(strtr(base64_encode($code_verifier), '+/', '-_'), '='); + $this->code_verifier = $code_verifier; $this->redirect_uri = $redirect_uri; $this->code = $code; $this->device_id = $device_id;