From 7ff6d6559a15838c1a7f917419ea45d1ed6121bc Mon Sep 17 00:00:00 2001 From: Curious George <101997181+curiousgeorgios@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:49:17 +1000 Subject: [PATCH] Update callback.ts to work with AU location (#16664) as per https://accounts.zoho.com/oauth/serverinfo, the server location for au is .com.au instead of .au Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> --- packages/app-store/zohocalendar/api/callback.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/app-store/zohocalendar/api/callback.ts b/packages/app-store/zohocalendar/api/callback.ts index ac36514d41..7c9449d1bc 100644 --- a/packages/app-store/zohocalendar/api/callback.ts +++ b/packages/app-store/zohocalendar/api/callback.ts @@ -51,7 +51,16 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) { redirect_uri: `${WEBAPP_URL}/api/integrations/${config.slug}/callback`, code, }; - const server_location = location === "us" ? "com" : location; + + let server_location; + + if (location === "us") { + server_location = "com"; + } else if (location === "au") { + server_location = "com.au"; + } else { + server_location = location; + } const query = stringify(params);