Am working with react app and the below code gives me management token in chrome but not in other browsers like firefox and edge.
const getLoggedIn = async () => {
try {
const response = await axios.post(
"https:///oauth/token",
new URLSearchParams({
grant_type: "client_credentials",
client_id: "xxxxxx",
client_secret:
"xxxx",
code: `code`,
redirect_uri: "https://.net/",
audience: "https://abc/api/v2/",
cacheLocation: "localstorage",
}),
{
headers: { "content-type": "application/x-www-form-urlencoded" },
}
);
console.log(response);
localStorage.setItem("mToken", response?.data?.access_token ?? "");
} catch (error) {
console.log(error);
}
};