Skip to content

Commit

Permalink
- [X] Fix UserSignature issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aemaddin committed Mar 10, 2024
1 parent 555aeae commit fdc6b00
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Zoho.php
Expand Up @@ -22,7 +22,7 @@ class Zoho
/**
* The Zoho library version.
*/
public const VERSION = '2.1.3';
public const VERSION = '2.1.4';

/**
* Indicates if Zoho migrations will be run.
Expand Down Expand Up @@ -78,7 +78,6 @@ public static function initialize($code = null): void

$environment = self::$environment ?: self::getDataCenterEnvironment();
$resourcePath = config('zoho.resourcePath');
$user = new UserSignature(config('zoho.current_user_email'));
$token_store = new FileStore(config('zoho.token_persistence_path'));
$logger = (new LogBuilder())->level(Levels::ALL)
->filePath(config('zoho.application_log_file_path'))
Expand All @@ -87,14 +86,14 @@ public static function initialize($code = null): void
switch (config('zoho.auth_flow_type')) {
case 'accessToken':
$token = (new OAuthBuilder())
->id(config("zoho.current_user_email"))
->userSignature(new UserSignature(config('zoho.current_user_email')))
->accessToken(config('zoho.token'))
->build();
break;

case 'refreshToken':
$token = (new OAuthBuilder())
->id(config("zoho.current_user_email"))
->userSignature(new UserSignature(config('zoho.current_user_email')))
->clientId(config('zoho.client_id'))
->clientSecret(config('zoho.client_secret'))
->refreshToken($code ?? config('zoho.token'))
Expand All @@ -104,7 +103,7 @@ public static function initialize($code = null): void

case 'grantToken':
$token = (new OAuthBuilder())
->id(config("zoho.current_user_email"))
->userSignature(new UserSignature(config('zoho.current_user_email')))
->clientId(config("zoho.client_id"))
->clientSecret(config("zoho.client_secret"))
->grantToken($code ?? config("zoho.token"))
Expand Down

0 comments on commit fdc6b00

Please sign in to comment.