HomePhabricator
Diffusion Comm 8d4e3f84c8db

[native][web] Regenerate QR code if any failures occur during login

Description

[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:

  1. I added a console log to see what the device ID is when the QR code is generated
  2. I hardcoded a throw new Error during identity auth and confirmed that the device ID doesn't change when the QR code is regenerated
  3. 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

Details

Provenance
ashoatAuthored on May 20 2024, 3:47 AM
Reviewer
bartek
Differential Revision
D12116: [native][web] Regenerate QR code if any failures occur during login
Parents
rCOMM682c73e8a1a4: [native][web] Avoid clearing unauthorizedDeviceID twice
Branches
Unknown
Tags
Unknown