hello i am trying to integrate Monday to my chrome extension, I am receiving the auth code and when i request token in exchange for the auth code i am receiving code 500 can someone point me to the right direction
some of the code I am using
chrome.identity.launchWebAuthFlow(
{
interactive: true,
url: `https://auth.monday.com/oauth2/authorize?client_id=${MONDAY_CLIENT_ID}&state=${MONDAY_STATE}&redirect_uri=${MONDAY_REDIRECT_URI}&scope=me:read+boards:read+boards:write+updates:write`,
},
(url?: string) => {
let code = url.substring(url.indexOf("code=") + "code=".length);
code = code.substring(0, code.indexOf("&"));
const requestTokenUrl = new URL("https://auth.monday.com/oauth2/token");
const params = { code, client_id:MONDAY_CLIENT_ID ,client_secret:CLIENT_SECRET};
requestTokenUrl.search = new URLSearchParams(params).toString();
axios.get(requestTokenUrl.toString()).then((res)=>{
console.log(res.data)
});
}
);
Check out the official documentation: https://apps.developer.monday.com/docs/oauth#token-request
From what I see, there are a few things you should change in your request to issue a token: