@@ -278,7 +278,7 @@ function AuthenticateComponent() {
278278 id : keyData . id ,
279279 ciphertext : Utils . bytesToHex ( keyBox . keyBoxCiphertext ) ,
280280 nonce : Utils . bytesToHex ( keyBox . keyBoxNonce ) ,
281- authorPublicKey : appIdentity . encryptionPublicKey ,
281+ authorPublicKey : keys . encryptionPublicKey ,
282282 accountAddress : accountAddress ,
283283 } ;
284284 } ) ;
@@ -405,27 +405,33 @@ function AuthenticateComponent() {
405405 rpcUrl : import . meta. env . VITE_HYPERGRAPH_RPC_URL ,
406406 } ) ;
407407
408+ const appIdentityKeys = {
409+ encryptionPrivateKey : newAppIdentity . encryptionPrivateKey ,
410+ encryptionPublicKey : newAppIdentity . encryptionPublicKey ,
411+ signaturePrivateKey : newAppIdentity . signaturePrivateKey ,
412+ signaturePublicKey : newAppIdentity . signaturePublicKey ,
413+ } ;
408414 console . log ( 'encrypting app identity' ) ;
409415 const { ciphertext, nonce } = await Connect . encryptAppIdentity (
410416 signer ,
411417 newAppIdentity . address ,
412418 newAppIdentity . addressPrivateKey ,
413419 permissionId ,
414- keys ,
420+ appIdentityKeys ,
415421 ) ;
416422 console . log ( 'proving ownership' ) ;
417423 const { accountProof, keyProof } = await Identity . proveIdentityOwnership (
418424 smartAccountClient ,
419425 accountAddress ,
420- keys ,
426+ appIdentityKeys ,
421427 ) ;
422428
423429 const message : Messages . RequestConnectCreateAppIdentity = {
424430 appId : state . appInfo . appId ,
425431 address : newAppIdentity . address ,
426432 accountAddress,
427- signaturePublicKey : keys . signaturePublicKey ,
428- encryptionPublicKey : keys . encryptionPublicKey ,
433+ signaturePublicKey : newAppIdentity . signaturePublicKey ,
434+ encryptionPublicKey : newAppIdentity . encryptionPublicKey ,
429435 ciphertext,
430436 nonce,
431437 accountProof,
@@ -449,10 +455,10 @@ function AuthenticateComponent() {
449455 address : newAppIdentity . address ,
450456 addressPrivateKey : newAppIdentity . addressPrivateKey ,
451457 accountAddress,
452- encryptionPrivateKey : keys . encryptionPrivateKey ,
453- signaturePrivateKey : keys . signaturePrivateKey ,
454- encryptionPublicKey : keys . encryptionPublicKey ,
455- signaturePublicKey : keys . signaturePublicKey ,
458+ encryptionPrivateKey : newAppIdentity . encryptionPrivateKey ,
459+ signaturePrivateKey : newAppIdentity . signaturePrivateKey ,
460+ encryptionPublicKey : newAppIdentity . encryptionPublicKey ,
461+ signaturePublicKey : newAppIdentity . signaturePublicKey ,
456462 sessionToken : appIdentityResponse . appIdentity . sessionToken ,
457463 sessionTokenExpires : new Date ( appIdentityResponse . appIdentity . sessionTokenExpires ) ,
458464 permissionId,
0 commit comments