[native][web] Regenerate QR code if any failures occur during login
Summary:
We want to regenerate the QR code because if a failure occurs during keyserver auth, it will result in the device keys changing.
My first thought was that we could have an effect regenerate the QR code, but I'm not sure how to subscribe to changes in the device ID.
Instead, I decided to handle it imperatively. This works because we wait until the database is reset before returning from useLogIn.
Depends on D12115
Test Plan:
- I added a console log to see what the device ID is when the QR code is generated
- I hardcoded a throw new Error during identity auth and confirmed that the device ID doesn't change when the QR code is regenerated
- I hardcoded a throw new Error during authoritative keyserver auth and confirmed that the device ID DOES change
Reviewers: bartek, tomek
Reviewed By: bartek
Differential Revision: https://phab.comm.dev/D12116