Skip to content

Commit e2bbaac

Browse files
ashutosh-revertjatinsandilya
authored andcommitted
fix: Added revert redirect uri
1 parent e3353d9 commit e2bbaac

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

packages/app-store/hubspot-revert/api/add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3737
res.status(200).json({
3838
url: `https://app.hubspot.com/oauth/authorize?client_id=${
3939
appKeys.client_id
40-
}&redirect_uri=http://localhost:3010/oauth-callback/hubspot&state={%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${
40+
}&redirect_uri=https://app.revert.dev/oauth-callback/hubspot&state={%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${
4141
process.env.REVERT_PUBLIC_TOKEN
4242
}%22}&scope=${scopes.join("%20")}`,
4343
newTab: true,

packages/app-store/salesforce-revert/api/add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3535
const queryParams = {
3636
response_type: "code",
3737
client_id: consumer_key,
38-
redirect_uri: `https://a3f9-103-183-24-51.ngrok-free.app/oauth-callback/sfdc`,
38+
redirect_uri: `https://app.revert.dev/oauth-callback/sfdc`,
3939
state: `{%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${process.env.REVERT_PUBLIC_TOKEN}%22}`,
4040
};
4141

packages/app-store/zohocrm-revert/api/add.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3232
});
3333
const tenantId = teamId ? teamId : userId;
3434
// @TODO check scopes before deployment
35-
const scopes = [
36-
"ZohoCRM.modules.ALL",
37-
"ZohoCRM.settings.ALL",
38-
"ZohoCRM.users.ALL",
39-
"AaaServer.profile.READ",
40-
];
35+
const scopes = ["ZohoCRM.modules.ALL", "ZohoCRM.users.READ", "AaaServer.profile.READ"];
4136

4237
const queryParams = {
4338
scope: scopes.join(","),
4439
client_id,
4540
response_type: "code",
4641
access_type: "offline",
47-
redirect_uri: "http://localhost:3010/oauth-callback/zohocrm",
42+
redirect_uri: "https://app.revert.dev/oauth-callback/zohocrm",
4843
state: `{%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${process.env.REVERT_PUBLIC_TOKEN}%22}`,
4944
};
5045

packages/app-store/zohocrm-revert/lib/CalendarService.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar {
163163
return await fetch(`${this.revertApiUrl}crm/events/${uid}`, requestOptions);
164164
};
165165

166-
private deleteMeeting = async (uid: any) => {
166+
private deleteMeeting = async (uid: string) => {
167167
const headers = new Headers();
168168
headers.append("x-revert-api-token", this.revertApiKey);
169169
headers.append("x-revert-t-id", this.tenantId);
@@ -180,9 +180,10 @@ export default class ZohoCRMRevertCalendarService implements Calendar {
180180
const meetingEvent = await (await this.createZohoCRMEvent(event, contacts)).json();
181181
if (meetingEvent && meetingEvent.status === "ok") {
182182
this.log.debug("event:creation:ok", { meetingEvent });
183+
183184
return Promise.resolve({
184-
uid: meetingEvent.result.id,
185-
id: meetingEvent.result.id,
185+
uid: meetingEvent.result.details.id,
186+
id: meetingEvent.result.details.id,
186187
type: appConfig.slug,
187188
password: "",
188189
url: "",
@@ -296,6 +297,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar {
296297
);
297298

298299
await this.createContacts(nonExistingContacts);
300+
299301
const meetingEvent = await (await this.updateMeeting(uid, event)).json();
300302
if (meetingEvent && meetingEvent.status === "ok") {
301303
this.log.debug("event:updation:ok", { meetingEvent });
@@ -312,7 +314,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar {
312314
return Promise.reject("Something went wrong when updating a meeting in ZOHO CRM");
313315
}
314316

315-
async deleteEvent(uid: any): Promise<void> {
317+
async deleteEvent(uid: string): Promise<void> {
316318
await this.deleteMeeting(uid);
317319
}
318320

0 commit comments

Comments
 (0)