[native] Add support for doNotRegister to useSIWEServerCall
Summary:
Back in D8753, we added this flag so that we could prevent web clients from registering an account via SIWE (ENG-2930).
For ENG-4074 we want to do something similar bit a little different on native. We have a SIWE flow for login, and are introducing a new one for registration. We want to use the doNotRegister flag to prevent account creation via the SIWE login flow, so that we can redirect the user to the registration flow.
Test Plan:
I tested this diff stack as follows:
- Delete test ETH account 1. Attempt to do main SIWE login with ETH account 1. Confirm it redirects to registration flow. Complete registration flow and confirm account successfully created
- Same as above, but go back after reaching the avatar screen, and then forward to see the Ethereum screen. Choose the option to use the already connected ETH account, then complete registration flow and confirm account successfully created
- Same as above, except in the Ethereum screen, choose the option to "skip" the Ethereum login. Confirm password account is successfully created
- Same as above, except in the Ethereum screen, select another Ethereum wallet that already has a Comm account. Confirm that we hit ExistingEthereumAccount, and that we're able to login directly with the existing account
- Same as above, except in the Ethereum screen, select another Ethereum wallet that doesn't already have a Comm account. Confirm that the account is successfully created using the second Ethereum wallet and not the first
- Same as above, except in the Ethereum screen, go through the auth flow again for the exact same wallet. Confirm that the account is successfully created
Note that I needed to apply this patch to work around ENG-6097.
Reviewers: atul, ginsu
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D10412