Skip to content

Commit 7a93c1e

Browse files
authored
fix: temporarily use gateway access token until host origin is fixed (#1518)
Signed-off-by: Norman <norman@samourai.coop>
1 parent fefe45d commit 7a93c1e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/components/OptimizedImage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ const transformURI = (
120120
return uri;
121121
}
122122

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

128130
const params = resolveParams(width, height);

0 commit comments

Comments
 (0)