Migration guide - OauthCompanyUser

Edit on GitHub

Upgrading from Version 1.x.x to 2.x.x

OauthCompanyUser module version 2.0.0 brings two major changes:

  • GLUE layer has been moved from Glue OauthCompanyUser to CompanyUserAuthRestApi (see Migration Guide - CompanyUserAuthRestApi for more details).
  • OauthCompanyUserConfig::OAUTH_CLIENT_IDENTIFIER, OauthCompanyUserConfig::OAUTH_CLIENT_SECRET constants have been removed.

BC Breaking changes:

  • Moved Glue layer to the CompanyUserAuthRestApi module.
  • Removed OauthCompanyUserConfig::getClientSecret().
  • Removed OauthCompanyUserConfig::getClientId().
  • Removed OauthCompanyUserConstants::OAUTH_CLIENT_IDENTIFIER.
  • Removed OauthCompanyUserConstants::OAUTH_CLIENT_SECRET.
  • Removed OauthCompanyUserClient::getClientSecret().
  • Removed OauthCompanyUserClient::getClientId().

To migrate do the following:

  1. Update composer:
composer require spryker/oauth-company-user: "^2.0.0" --update-with-dependencies
  1. Generate transfer:
vendor/bin/console transfer:generate
  1. Remove constants in the config/Shared/config_default.php, config/Shared/config_default-development.php, and config/Shared/config_default-devtest.php files:
$config[OauthCompanyUserConstants::OAUTH_CLIENT_IDENTIFIER] = '';
$config[OauthCompanyUserConstants::OAUTH_CLIENT_SECRET] = '';

Instead of this usage, use constants from the Oauth module:

$config[OauthConstants::OAUTH_CLIENT_IDENTIFIER] = '';
$config[OauthConstants::OAUTH_CLIENT_SECRET] = '';
  1. In the \Pyz\Glue\AuthRestApi\AuthRestApiDependencyProvider::getRestUserExpanderPlugins() replace Spryker\Glue\OauthCompanyUser\Plugin\AuthRestApi\CompanyUserRestUserMapperPlugin to Spryker\Glue\CompanyUserAuthRestApi\Plugin\AuthRestApi\CompanyUserRestUserMapperPlugin:
- use Spryker\Glue\OauthCompanyUser\Plugin\AuthRestApi\CompanyUserRestUserMapperPlugin;
+ use Spryker\Glue\CompanyUserAuthRestApi\Plugin\AuthRestApi\CompanyUserRestUserMapperPlugin;

Estimated migration time: ~10m