Page MenuHomePhabricator

[web] Have user sign SIWEMessage with wallet and hit `siwe_auth` endpoint
ClosedPublic

Authored by atul on Jan 20 2023, 11:53 AM.
Tags
None
Referenced Files
F3391056: D6326.id21178.diff
Sat, Nov 30, 2:07 AM
F3390983: D6326.id21155.diff
Sat, Nov 30, 1:48 AM
Unknown Object (File)
Tue, Nov 26, 10:11 PM
Unknown Object (File)
Sat, Nov 23, 5:25 AM
Unknown Object (File)
Sat, Nov 23, 5:21 AM
Unknown Object (File)
Sat, Nov 23, 5:20 AM
Unknown Object (File)
Sat, Nov 23, 5:15 AM
Unknown Object (File)
Sat, Nov 23, 5:06 AM
Subscribers
None

Details

Summary

We prompt user to sign SIWEMessage with their wallet when "Sign in" is clicked. Once the message is signed, the user will be logged into the web app.

Test Plan

MetaMask:

5d3d74.png (2×1 px, 387 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul requested review of this revision.Jan 20 2023, 12:15 PM
atul retitled this revision from [web] Prompt user to sign SIWEMessage with wallet when "Sign in" clicked to [web] Have user sign SIWEMessage with wallet and hit `siwe_auth` endpoint.Jan 21 2023, 3:17 PM
atul edited the summary of this revision. (Show Details)
ashoat added inline comments.
web/account/siwe.react.js
108–114 ↗(On Diff #21166)

I think omitting the extra await keyword here is better for performance because it avoids an interupt. Also this looks cleaner

119 ↗(On Diff #21166)

This doesn't need to be an async function

This revision is now accepted and ready to land.Jan 21 2023, 3:34 PM

rebase before addressing feedback

web/account/siwe.react.js
108 ↗(On Diff #21175)

The async should not be there... you're returning a Promise<Promise<something>> now

If you ever have an async function without an await keyword inside, that's generally (not always) a red flag

This revision is now accepted and ready to land.Jan 22 2023, 5:14 PM
This revision was landed with ongoing or failed builds.Jan 22 2023, 5:16 PM
This revision was automatically updated to reflect the committed changes.