diff --git a/dapp/src/pages/api/w3up-delegation.js b/dapp/src/pages/api/w3up-delegation.js index cbbb14e..b8a4737 100644 --- a/dapp/src/pages/api/w3up-delegation.js +++ b/dapp/src/pages/api/w3up-delegation.js @@ -47,11 +47,19 @@ async function backend(did) { "filecoin/offer", "upload/add", ]; - const expiration = Math.floor(Date.now() / 1000) + 10; + const expiration = Math.floor(Date.now() / 1000) + 86400; + const expirationDate = new Date(expiration * 1000); + console.log("expiration time:", expirationDate.toUTCString()); + const delegation = await client.createDelegation(audience, abilities, { expiration, }); + console.log( + "delegation expire time:", + new Date(delegation.expiration * 1000).toUTCString(), + ); + const archive = await delegation.archive(); return archive.ok; }