4

I use dektrium/yii2-user (on one project) and yiisoft/yii2-authclient (on another one) to login via Google account. Some time ago it was everything ok, but i guess after last composer update something was changed and now i get an error: "Class yii\authclient\clients\GoogleOAuth does not exist" when try to open login page. Does anybody has the same issue or know what's wrong? Thank you

Iana Tempos
  • 582
  • 4
  • 13

3 Answers3

6

yii2-authclient has been modified in the latest version which is not backward compatible.
Read about the upgrade process here.

Two solutions:

  1. Modify composer.json to fetch 2.0.6 version (replace * with 2.0.6) - no other changes are needed but no more updates for this extension.
  2. Upgrade your code following the guide in the link above so you can be up-to-date.
Bizley
  • 17,392
  • 5
  • 49
  • 59
4

In the config file Replace from

'google'   => [
            'class'        => 'yii\authclient\clients\GoogleOAuth',
            ..
        ],

Replace to

'google' => [ 'class' => 'yii\authclient\clients\Google', ... ],

2

Use yii\authclient\clients\Google instead of yii\authclient\clients\GoogleOAuth in your config file.

Chaitenya
  • 329
  • 2
  • 10