Skip to content

Commit

Permalink
Fix webpack-5 example to use ConditionContext instead of directly pro…
Browse files Browse the repository at this point in the history
…viding auth provider.
  • Loading branch information
derekpierre committed Aug 15, 2024
1 parent e613d3a commit e9e332f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/taco/webpack-5/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
fromBytes,
initialize,
toBytes,
USER_ADDRESS_PARAM_DEFAULT,
} from '@nucypher/taco';
import { ethers } from 'ethers';
import { hexlify } from 'ethers/lib/utils';
Expand Down Expand Up @@ -61,11 +62,14 @@ const runExample = async () => {

console.log('Decrypting message...');
const authProvider = new EIP4361AuthProvider(provider, signer);
const conditionContext =
conditions.context.ConditionContext.fromMessageKit(messageKit);
conditionContext.addAuthProvider(USER_ADDRESS_PARAM_DEFAULT, authProvider);
const decryptedBytes = await decrypt(
provider,
domain,
messageKit,
authProvider,
conditionContext,
);
const decryptedMessage = fromBytes(decryptedBytes);
console.log('Decrypted message:', decryptedMessage);
Expand Down

0 comments on commit e9e332f

Please sign in to comment.