decred / politeiagui

ISC License
62 stars 56 forks source link

legacy: Fix invalid signature on user key verify #2842

Closed victorgcramos closed 2 years ago

victorgcramos commented 2 years ago

Closes #2841

This diff fixes an annoying bug constantly reported on support channel (here's an example), where new keys were generated on GUI before sending them to the server, leading to the following error message:

2841-invalid-signature-idenitit

This issue gets fixed by updating user keys only when the /user/key request succeeds.

How to test on dev environment
  1. Create a new user: pictl usernew test@example.com test password --verify
  2. login
  3. go to Account > Identity
  4. open the network panel on your browser to get the verificationtoken
  5. Click on the "Create new identity" button
  6. write down the verificationtoken (on production mode, the verification token will be sent to user's email).
  7. Create another identity (you can do that multiple times)
  8. Navigate to /user/key/verify?verificationtoken=<your-verificationtoken>
  9. Done! (on current master, that's when the bug happens).