diff --git a/packages/v1-ready/zoho-crm/README.md b/packages/v1-ready/zoho-crm/README.md index f33ef9d..bcd06e6 100644 --- a/packages/v1-ready/zoho-crm/README.md +++ b/packages/v1-ready/zoho-crm/README.md @@ -52,7 +52,7 @@ If you've already done this, skip to the next section. ```shell ZOHO_CRM_CLIENT_ID=your_client_id ZOHO_CRM_CLIENT_SECRET=your_client_secret - ZOHO_CRM_SCOPE=ZohoCRM.users.ALL ZohoCRM.org.ALL ZohoCRM.settings.roles.ALL ZohoCRM.settings.profiles.ALL ZohoCRM.modules.contacts.ALL ZohoCRM.modules.leads.ALL ZohoCRM.modules.accounts.ALL ZohoCRM.modules.calls.ALL + ZOHO_CRM_SCOPE=ZOHO_CRM_SCOPE=ZohoCRM.org.ALL ZohoCRM.users.ALL ZohoCRM.settings.roles.ALL ZohoCRM.settings.profiles.ALL ZohoCRM.modules.contacts.ALL ZohoCRM.modules.accounts.ALL ZohoCRM.modules.leads.ALL ZohoCRM.notifications.ALL ZohoCRM.modules.notes.ALL ZohoCRM.modules.calls.ALL REDIRECT_URI=http://localhost:3000/redirect ``` diff --git a/packages/v1-ready/zoho-crm/src/api.ts b/packages/v1-ready/zoho-crm/src/api.ts index e4a8396..aada8d7 100644 --- a/packages/v1-ready/zoho-crm/src/api.ts +++ b/packages/v1-ready/zoho-crm/src/api.ts @@ -72,7 +72,7 @@ export class Api extends OAuth2Requester { this.baseUrl = `${locationConfig.api}/crm/v8`; this.tokenUri = `${locationConfig.accounts}/oauth/v2/token`; this.authorizationUri = encodeURI( - `${locationConfig.accounts}/oauth/v2/auth?scope=${this.scope}&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&access_type=offline` + `${locationConfig.accounts}/oauth/v2/auth?scope=${this.scope}&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&access_type=offline&prompt=consent` ); this.access_token = get(params, 'access_token', null); this.refresh_token = get(params, 'refresh_token', null); @@ -114,7 +114,7 @@ export class Api extends OAuth2Requester { this.baseUrl = `${locationConfig.api}/crm/v8`; this.tokenUri = `${locationConfig.accounts}/oauth/v2/token`; this.authorizationUri = encodeURI( - `${locationConfig.accounts}/oauth/v2/auth?scope=${this.scope}&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&access_type=offline` + `${locationConfig.accounts}/oauth/v2/auth?scope=${this.scope}&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&access_type=offline&prompt=consent` ); } @@ -133,6 +133,7 @@ export class Api extends OAuth2Requester { }; const response = await this._post(options, false); + console.log('[Zoho API] Token response:', JSON.stringify(response)); await this.setTokens(response); return response; }