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)
Mon, Apr 22, 11:18 AM
Unknown Object (File)
Mon, Apr 22, 11:18 AM
Unknown Object (File)
Mon, Apr 22, 11:18 AM
Unknown Object (File)
Mon, Apr 22, 11:18 AM
Unknown Object (File)
Mon, Apr 22, 11:15 AM
Unknown Object (File)
Sat, Apr 13, 7:38 AM
Unknown Object (File)
Feb 24 2024, 1:10 AM
Unknown Object (File)
Feb 24 2024, 12:31 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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