fix: incorrect client_id parameter assignment in generating access token for webex (#11472)
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>pull/9754/head^2
parent
5940f9bccd
commit
798707a553
|
@ -17,14 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
const redirectUri = encodeURI(`${WEBAPP_URL}/api/integrations/${config.slug}/callback`);
|
const redirectUri = encodeURI(`${WEBAPP_URL}/api/integrations/${config.slug}/callback`);
|
||||||
const authHeader = "Basic " + Buffer.from(client_id + ":" + client_secret).toString("base64");
|
const authHeader = "Basic " + Buffer.from(client_id + ":" + client_secret).toString("base64");
|
||||||
const result = await fetch(
|
const result = await fetch(
|
||||||
"https://webexapis.com/v1/access_token?grant_type=authorization_code&client_id" +
|
`https://webexapis.com/v1/access_token?grant_type=authorization_code&client_id=${client_id}&client_secret=${client_secret}&code=${code}&redirect_uri=${redirectUri}`,
|
||||||
client_id +
|
|
||||||
"&client_secret=" +
|
|
||||||
client_secret +
|
|
||||||
"&code=" +
|
|
||||||
code +
|
|
||||||
"&redirect_uri=" +
|
|
||||||
redirectUri,
|
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Reference in New Issue