Skip to content

Commit

Permalink
Fix missing root path prefix from file path
Browse files Browse the repository at this point in the history
  • Loading branch information
tr33m4n committed Jan 5, 2023
1 parent 11a5713 commit 977ea25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Model/Client/ConfigureAuthConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Magento\Framework\Filesystem;
use Magento\Framework\Filesystem\Directory\ReadInterface;
use tr33m4n\OauthGmail\Exception\AuthConfigException;
use tr33m4n\OauthGmail\Model\Config\Backend\AuthFile;
use tr33m4n\OauthGmail\Model\Config\Source\AuthType;

class ConfigureAuthConfig
Expand Down Expand Up @@ -59,7 +60,12 @@ public function execute(Client $client): Client
switch ($this->scopeConfig->getValue(self::XML_CONFIG_AUTH_TYPE)) {
case AuthType::AUTH_TYPE_FILE:
$authFile = $this->varDirectory->getAbsolutePath(
$this->scopeConfig->getValue(self::XML_CONFIG_AUTH_FILE)
sprintf(
'%s%s%s',
AuthFile::ROOT_PATH,
DIRECTORY_SEPARATOR,
$this->scopeConfig->getValue(self::XML_CONFIG_AUTH_FILE)
)
);

if (!$this->varDirectory->isExist($authFile)) {
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Config/Backend/AuthFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

class AuthFile extends File
{
public const ROOT_PATH = 'oauth_gmail';

/**
* AuthFile constructor.
*
Expand Down

0 comments on commit 977ea25

Please sign in to comment.