Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/components/OptimizedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ const transformURI = (
return uri;
}

// XXX: pass gateway token from env to get images in localhost
if (uri?.startsWith("ipfs://")) {
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain`;
// FIXME: passing the gateway token here is unsafe and people could rip our cap but the host origin method seems broken atm
const gatewayAccessToken =
"0Ik-SBA6O3xxcvHBRmD526aG06EEwIqwcr14MFfFveyotZmOI4v9gLfJgHW3SRFY";
return `https://teritori.mypinata.cloud/ipfs/${uri.substring("ipfs://".length)}?img-width=${Math.round(width)}&img-height=${Math.round(height)}&img-fit=contain&pinataGatewayToken=${gatewayAccessToken}`;
}

const params = resolveParams(width, height);
Expand Down
Loading