Page MenuHomePhabricator

[native] Factor out success behavior in SIWEPanel
ClosedPublic

Authored by ashoat on May 18 2023, 11:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 7:24 AM
Unknown Object (File)
Fri, Nov 29, 7:20 AM
Unknown Object (File)
Nov 22 2024, 1:51 PM
Unknown Object (File)
Nov 22 2024, 8:55 AM
Unknown Object (File)
Nov 14 2024, 11:24 AM
Unknown Object (File)
Nov 14 2024, 11:24 AM
Unknown Object (File)
Nov 14 2024, 11:24 AM
Unknown Object (File)
Nov 14 2024, 11:23 AM
Subscribers

Details

Summary

In the old flow, we would call the keyserver immediately after receiving a signed message from a user's wallet.

In the new flow, there are still some steps afterwards before we call the keyserver.

To make SIWEPanel support both cases, this diff:

  1. Factors out the SIWE server call and related logic into a useSIWEServerCall hook
  2. Add a new prop called onSuccessfulWalletSignature to SIWEPanel
  3. "Lift" the SIWE server call logic in SIWEPanel up to FullscreenSIWEPanel, one of its parents
  4. Use useSIWEServerCall in FullscreenSIWEPanel
Test Plan

Make sure the old SIWE flow still works

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/registration
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/account/siwe-panel.react.js
120–153 ↗(On Diff #26656)

This logic was moved to useSIWEServerCall cleanly, with the exception of the Alert callback, which is now defined in FullscreenSIWEPanel, where it gets passed to useSIWEServerCall.

  1. Pass address in as well. This can be concluded from the message, but processing that seems wasteful since we have the data in SIWEPanel
  2. Now that we have 3 strings, I'm using an object instead of a list of params
This revision is now accepted and ready to land.May 19 2023, 10:59 AM