0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

fix(runtime): prevent use api credentials

This commit is contained in:
Juanfran 2024-06-03 12:02:51 +02:00
parent 0eadac1e75
commit 1699e6dedb

View file

@ -35,7 +35,14 @@ export const ɵloadPlugin = async function (manifest: Manifest) {
const c = new Compartment({
penpot: harden(pluginApi),
fetch: window.fetch.bind(window),
fetch: harden((...args: Parameters<typeof fetch>) => {
const requestArgs: RequestInit = {
...args[1],
credentials: 'omit',
};
return fetch(args[0], requestArgs);
}),
console: harden(window.console),
Math: harden(Math),
setTimeout: harden(