Skip to content

Commit 904d25f

Browse files
committed
don't store sessions
1 parent bce4469 commit 904d25f

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

src/index.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Signature } from 'ethers';
88
import { createLitClient } from '@lit-protocol/lit-client';
99
import { getIpfsId } from '@lit-protocol/lit-client/ipfs';
1010
import { nagaDev, nagaTest, naga as nagaMainnet } from '@lit-protocol/networks';
11-
import { createAuthManager, storagePlugins } from '@lit-protocol/auth';
11+
import { createAuthManager } from '@lit-protocol/auth';
1212
import { LitActionResource } from '@lit-protocol/auth-helpers';
1313
import { LIT_ABILITY } from '@lit-protocol/constants';
1414
import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts';
@@ -125,14 +125,23 @@ function getPrivateKey(): `0x${string}` {
125125
return cachedPrivateKey;
126126
}
127127

128-
function createFreshAuthManager() {
129-
const storage = storagePlugins.localStorageNode({
130-
appName: 'drips-app',
131-
networkName: getLitNetworkName(),
132-
storagePath: join(currentDir, '.lit-auth-storage'),
133-
});
134-
return createAuthManager({ storage });
135-
}
128+
const noopStorage = {
129+
config: {},
130+
async read() { return null; },
131+
async write() {},
132+
async writeInnerDelegationAuthSig() {},
133+
async readInnerDelegationAuthSig() { return null; },
134+
async writePKPTokens() {},
135+
async readPKPTokens() { return null; },
136+
async writePKPDetails() {},
137+
async readPKPDetails() { return null; },
138+
async writePKPTokensByAddress() {},
139+
async readPKPTokensByAddress() { return null; },
140+
async writePKPs() {},
141+
async readPKPs() { return null; },
142+
};
143+
144+
const authManager = createAuthManager({ storage: noopStorage });
136145

137146
const LIT_TIMEOUT_MS = 60_000;
138147
const LIT_MAX_RETRIES = 2;
@@ -157,7 +166,6 @@ async function executeLitAction(source: { kind: string; name: string }, chainNam
157166
const account = privateKeyToAccount(getPrivateKey());
158167
const ipfsCid = await getLitActionIpfsCid();
159168

160-
const authManager = createFreshAuthManager();
161169
const authContext = await authManager.createEoaAuthContext({
162170
litClient,
163171
config: { account },

0 commit comments

Comments
 (0)