Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/v1-ready/zoho-crm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
5 changes: 3 additions & 2 deletions packages/v1-ready/zoho-crm/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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`
);
}

Expand All @@ -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;
}
Expand Down
Loading