SDK Versions
- @web3auth/mpc-core-kit@2.3.0
- @tkey-mpc/core@9.1.1
- @tkey-mpc/storage-layer-torus@9.1.0
This issue is related to the concurrent login issue, #115.
Steps to reproduce
- concurrently login with new user email (as of latest
tkey-core sdk (v9.1.1), the logins will be success without any errors)
- log into another coreKit instance with the email used above
- it will throw an error which indicates
factor key is not present (note: with manualSync:false, it will throw a different error, COREKIT_STATUS.REQUIRED_SHARE which is caused by factor not present)
A little bit more details about the issues
By following the trace, I found that the error is located in coreKit setupTkey method:
- at https://github.com/Web3Auth/mpc-core-kit/blob/master/src/mpcCoreKit.ts#L901, we check the existing metadata with
OAuthKey we got from the login
- since this is the existing email, there's an existing metadata and we assume this account as existing user
- then we continue to the usual steps for the existing user and here, https://github.com/Web3Auth/mpc-core-kit/blob/master/src/mpcCoreKit.ts#L939, we create a
hashedFactorKey and validate it by checking the metadata again
- however, there's no metadata related to the
hashedFactorKey we created above, hence skipping all the later steps and methods including the one which set the factor key
- the above will result in
unable to login when using manualSync:false and factor not present when using manualSync:true
SDK Versions
Steps to reproduce
tkey-core sdk (v9.1.1), the logins will be success without any errors)factor key is not present(note: withmanualSync:false, it will throw a different error,COREKIT_STATUS.REQUIRED_SHAREwhich is caused by factor not present)A little bit more details about the issues
By following the trace, I found that the error is located in coreKit
setupTkeymethod:OAuthKeywe got from the loginhashedFactorKeyand validate it by checking the metadata againhashedFactorKeywe created above, hence skipping all the later steps and methods including the one which set thefactor keyunable to loginwhen usingmanualSync:falseandfactor not presentwhen usingmanualSync:true