Web3Auth / mpc-core-kit

16 stars 4 forks source link

Factorkey validation and rehydration error #132

Open lwin-kyaw opened 5 months ago

lwin-kyaw commented 5 months ago

This PR includes -

ieow commented 5 months ago

Can you elaborate the issue ? why the need to throw on rehydrate failed?

lwin-kyaw commented 5 months ago

Can you elaborate the issue ? why the need to throw on rehydrate failed?

Hi, we don't necessarily need to throw rehydration error as when rehydration failed, all the later steps will also fail (factor login, create factor, etc...). However throwing error on rehydration failed, can catch some errors in early stage and prevent users proceeding to other steps. Anyway, we have logged out the error message when there's an error during rehydration, so, I think it would be better if we could throw the error also. It will also help us to write better test cases.

Sample case on rehydration failure