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)
Thu, Oct 24, 4:36 AM
Unknown Object (File)
Thu, Oct 24, 2:33 AM
Unknown Object (File)
Thu, Oct 24, 1:30 AM
Unknown Object (File)
Thu, Oct 24, 1:04 AM
Unknown Object (File)
Thu, Oct 24, 12:50 AM
Unknown Object (File)
Wed, Oct 23, 10:59 PM
Unknown Object (File)
Wed, Oct 23, 10:32 PM
Unknown Object (File)
Wed, Oct 23, 10:00 PM
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