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>
This commit is contained in:
Curious George
2024-09-16 12:49:17 +00:00
committed by GitHub
co-authored by Anik Dhabal Babu
parent 2572a5cb93
commit 7ff6d6559a
@@ -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);