@@ -5,9 +5,7 @@ import { init } from '../init';
55 */
66export const createPkpAuthContext : (
77 ctx : Awaited < ReturnType < typeof init > >
8- ) => Promise < any > = async (
9- ctx : Awaited < ReturnType < typeof init > >
10- ) => {
8+ ) => Promise < any > = async ( ctx : Awaited < ReturnType < typeof init > > ) => {
119 console . log ( '🔁 Creating PKP Auth Context' ) ;
1210 try {
1311 const pkpAuthContext = await ctx . authManager . createPkpAuthContext ( {
@@ -37,22 +35,14 @@ export const createPkpAuthContext: (
3735 */
3836export const createCustomAuthContext : (
3937 ctx : Awaited < ReturnType < typeof init > >
40- ) => Promise < any > = async (
41- ctx : Awaited < ReturnType < typeof init > >
42- ) => {
38+ ) => Promise < any > = async ( ctx : Awaited < ReturnType < typeof init > > ) => {
4339 console . log ( '🔁 Creating Custom Auth Context' ) ;
40+
4441 try {
4542 // Set up custom auth method type and validation IPFS CID (from custom-auth-flow example)
46- const uniqueDappName = 'e2e-test-dapp' ;
47- const uniqueAuthMethodType = hexToBigInt (
48- keccak256 ( toBytes ( uniqueDappName ) )
49- ) ;
50- const uniqueUserId = `${ uniqueDappName } -alice` ;
51- const authMethodId = keccak256 ( toBytes ( uniqueUserId ) ) ;
52- const validationIpfsCid = 'QmYLeVmwJPVs7Uebk85YdVPivMyrvoeKR6X37kyVRZUXW4' ;
5343
5444 const customAuthContext = await ctx . authManager . createCustomAuthContext ( {
55- pkpPublicKey : ctx . aliceViemAccountPkp . publicKey ,
45+ pkpPublicKey : ctx . eveViemAccountPkp . pubkey ,
5646 authConfig : {
5747 resources : [
5848 [ 'pkp-signing' , '*' ] ,
@@ -63,17 +53,17 @@ export const createCustomAuthContext: (
6353 } ,
6454 litClient : ctx . litClient ,
6555 customAuthParams : {
66- litActionIpfsId : validationIpfsCid ,
56+ litActionIpfsId : ctx . eveValidationIpfsCid ,
6757 jsParams : {
68- pkpPublicKey : ctx . aliceViemAccountPkp . publicKey ,
69- username : 'alice ' ,
58+ pkpPublicKey : ctx . eveViemAccountPkp . pubkey ,
59+ username : 'eve ' ,
7060 password : 'lit' ,
71- authMethodId : authMethodId ,
61+ authMethodId : ctx . eveCustomAuthData . authMethodId ,
7262 } ,
7363 } ,
7464 } ) ;
7565
76- console . log ( '✅ Custom Auth Context created' ) ;
66+ console . log ( '✅ Custom Auth Context created' , customAuthContext ) ;
7767 return customAuthContext ;
7868 } catch ( e ) {
7969 console . error ( '❌ Error creating Custom Auth Context' , e ) ;
0 commit comments