File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,10 @@ private function getTokensFromJSON($responseObj)
116
116
{
117
117
$ oAuthTokens = new ZohoOAuthTokens ();
118
118
$ expiresIn = $ responseObj [ZohoOAuthConstants::EXPIRES_IN ];
119
+ if (!array_key_exists (ZohoOAuthConstants::EXPIRES_IN_SEC ,$ responseObj )){
120
+ $ expiresIn =$ expiresIn *1000 ;
121
+ }
119
122
$ oAuthTokens ->setExpiryTime ($ oAuthTokens ->getCurrentTimeInMillis () + $ expiresIn );
120
-
121
123
$ accessToken = $ responseObj [ZohoOAuthConstants::ACCESS_TOKEN ];
122
124
$ oAuthTokens ->setAccessToken ($ accessToken );
123
125
if (array_key_exists (ZohoOAuthConstants::REFRESH_TOKEN , $ responseObj )) {
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ class ZohoOAuthConstants
48
48
49
49
const EXPIRES_IN = "expires_in " ;
50
50
51
+ const EXPIRES_IN_SEC = "expires_in_sec " ;
52
+
51
53
const EXPIRIY_TIME = "expiry_time " ;
52
54
53
55
const PERSISTENCE_HANDLER_CLASS = "persistence_handler_class " ;
You can’t perform that action at this time.
0 commit comments