HomePhabricator
Diffusion Comm 4351e87ec236

[native] Hit `siwe_nonce` endpoint and pass `nonce` to SIWE `WebView`

Description

[native] Hit siwe_nonce endpoint and pass nonce to SIWE WebView

Summary:
We make a call to siwe_nonce from native to fetch a nonce from the keyserver.

Once we have the nonce we pass it to the WebView that loads /commlanding/siwe by including it as a header passed through the source prop.

We use createLoadingStatusSelector to determine whether the request failed, in which case we display an error message.

If the request has succeeded we should have a nonce in which case we render the WebView.

Finally, if the request has neither succeeded or failed we display a spinner (via ActivityIndicator) to indicate that the request is in progress.


Depends on D5965

Test Plan:

  • Logged values and set breakpoints to ensure that things were as expected.
  • Used Redux remote dev tools to ensure that loadingStatuses were as expected at each action
  • Killed keyserver and made sure that error message was displayed instead of ActivityIndicator spinning indefinitely

Reviewers: ashoat, tomek

Reviewed By: tomek

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

Details

Provenance
atulAuthored on Dec 21 2022, 10:25 AM
Reviewer
tomek
Differential Revision
D5966: [native] Hit `siwe_nonce` endpoint and pass `nonce` to SIWE `WebView`
Parents
rCOMM08a6eeaec8a3: [lib] Fix return value of `getSIWENonce`
Branches
Unknown
Tags
Unknown