HomePhabricator
Diffusion Comm 424ea6f92e58

[lib][native] Defer saving user credentials until successful auth

Description

[lib][native] Defer saving user credentials until successful auth

Summary:
We're currently saving the user credentials after a successful auth with identity. This diff makes it so we wait until the whole auth concludes before we save the user credentials. This allows us to simplify some code, and is more consistent with how we're handling other side effects of auth: treating the auth as a single cohesive flow, and not considering it successful unless all parts succeed.

Depends on D11765

Test Plan:
This whole stack was tested with the following steps:

  1. On native, attempting to log in with an ETH account that hasn’t been registered yet
  2. On native, attemping to register with an ETH account that has already been registered
  3. On native, log in with an ETH account that has already been registered
  4. On native, register with an ETH account that hasn’t already been registered
  5. On native, register with a password account
  6. On native, log in with a password account
  7. On web, attempting to log in with an ETH account that hasn’t been registered yet
  8. On web, log in with an ETH account that has already been registered
  9. On web, log in with a password account

Reviewers: tomek, inka

Reviewed By: inka

Differential Revision: https://phab.comm.dev/D11766

Details

Provenance
ashoatAuthored on Apr 23 2024, 10:48 AM
Reviewer
inka
Differential Revision
D11766: [lib][native] Defer saving user credentials until successful auth
Parents
rCOMMb1dff3d63e23: [lib][native][web] Introduce usePasswordLogIn hook
Branches
Unknown
Tags
Unknown