[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:
- On native, attempting to log in with an ETH account that hasn’t been registered yet
- On native, attemping to register with an ETH account that has already been registered
- On native, log in with an ETH account that has already been registered
- On native, register with an ETH account that hasn’t already been registered
- On native, register with a password account
- On native, log in with a password account
- On web, attempting to log in with an ETH account that hasn’t been registered yet
- On web, log in with an ETH account that has already been registered
- On web, log in with a password account
Reviewers: tomek, inka
Reviewed By: inka
Differential Revision: https://phab.comm.dev/D11766