-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
SDK Versions
- @web3auth/[email protected]
- @tkey-mpc/[email protected]
- @tkey-mpc/[email protected]
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: 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 setupTkey method:
- at https://github.com/Web3Auth/mpc-core-kit/blob/master/src/mpcCoreKit.ts#L901, we check the existing metadata with
OAuthKeywe 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
hashedFactorKeyand validate it by checking the metadata again - however, there's no metadata related to the
hashedFactorKeywe created above, hence skipping all the later steps and methods including the one which set thefactor key - the above will result in
unable to loginwhen usingmanualSync:falseandfactor not presentwhen usingmanualSync:true
Metadata
Metadata
Assignees
Labels
No labels