diff --git a/Model/CreateUserFromGoogleUserInfo.php b/Model/CreateUserFromGoogleUserInfo.php index dced25b..991828b 100644 --- a/Model/CreateUserFromGoogleUserInfo.php +++ b/Model/CreateUserFromGoogleUserInfo.php @@ -8,7 +8,7 @@ namespace MSP\BackendGoogleSignOn\Model; -use Google_Service_Oauth2_Userinfoplus; +use Google_Service_Oauth2_Userinfo; use Magento\Framework\Exception\AlreadyExistsException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\User\Model\ResourceModel\User as UserResource; @@ -74,10 +74,10 @@ private function userExistsByEmail(string $email): bool /** * Create a new admin user if not exists based on google info * - * @param Google_Service_Oauth2_Userinfoplus $userInfo + * @param Google_Service_Oauth2_Userinfo $userInfo * @throws AlreadyExistsException */ - public function execute(Google_Service_Oauth2_Userinfoplus $userInfo): void + public function execute(Google_Service_Oauth2_Userinfo $userInfo): void { $rule = $this->getDomainRule->execute($userInfo->getHd()); diff --git a/Model/GetGoogleUserInfo.php b/Model/GetGoogleUserInfo.php index 61acac2..6fa90af 100644 --- a/Model/GetGoogleUserInfo.php +++ b/Model/GetGoogleUserInfo.php @@ -8,7 +8,7 @@ namespace MSP\BackendGoogleSignOn\Model; -use Google_Service_Oauth2_Userinfoplus; +use Google_Service_Oauth2_Userinfo; use Magento\Framework\Exception\LocalizedException; /** @@ -42,10 +42,10 @@ public function __construct( * Authenticate through the Google Auth code response * * @param string $authCode - * @return Google_Service_Oauth2_Userinfoplus + * @return Google_Service_Oauth2_Userinfo * @throws LocalizedException */ - public function execute(string $authCode): Google_Service_Oauth2_Userinfoplus + public function execute(string $authCode): Google_Service_Oauth2_Userinfo { $googleClient = $this->getGoogleClient->execute(); diff --git a/Test/Integration/CreateUserFromGoogleUserInfoTest.php b/Test/Integration/CreateUserFromGoogleUserInfoTest.php index 3f80957..d0eb084 100644 --- a/Test/Integration/CreateUserFromGoogleUserInfoTest.php +++ b/Test/Integration/CreateUserFromGoogleUserInfoTest.php @@ -9,7 +9,7 @@ namespace MSP\BackendGoogleSignOn\Test\Integration; -use Google_Service_Oauth2_Userinfoplus; +use Google_Service_Oauth2_Userinfo; use Magento\Framework\Exception\NoSuchEntityException; use Magento\User\Model\User; use MSP\BackendGoogleSignOn\Model\CreateUserFromGoogleUserInfo; @@ -66,7 +66,7 @@ private function getUserByEmail(string $email): ?User */ public function testShouldCreateNewUser(): void { - $googleInfo = new Google_Service_Oauth2_Userinfoplus(); + $googleInfo = new Google_Service_Oauth2_Userinfo(); $googleInfo->setGivenName('John'); $googleInfo->setFamilyName('Doe'); $googleInfo->setEmail('some@mydomain3.com'); @@ -87,7 +87,7 @@ public function testShouldCreateNewUser(): void */ public function testShouldNotCreateNewUserWithADomainRule(): void { - $googleInfo = new Google_Service_Oauth2_Userinfoplus(); + $googleInfo = new Google_Service_Oauth2_Userinfo(); $googleInfo->setGivenName('John'); $googleInfo->setFamilyName('Doe'); $googleInfo->setEmail('some@mydomain.com'); @@ -104,7 +104,7 @@ public function testShouldNotCreateNewUserWithADomainRule(): void */ public function testShouldNotCreateNewUserWithoutADomainRule(): void { - $googleInfo = new Google_Service_Oauth2_Userinfoplus(); + $googleInfo = new Google_Service_Oauth2_Userinfo(); $googleInfo->setGivenName('John'); $googleInfo->setFamilyName('Doe'); $googleInfo->setEmail('some@gmail.com'); diff --git a/composer.json b/composer.json index 8e0dd66..edd4efe 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "magento/magento2-base": "^2.3", "magento/module-backend": "*", "magento/module-user": "*", - "google/apiclient": "^2.4" + "google/apiclient": "2.6.*" }, "support": { "issues": "https://github.com/magespecialist/m2-GoogleSignOn/issues"