snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
16 stars 16 forks source link

feat: support read-only guest login #959

Open bonustrack opened 5 days ago

bonustrack commented 5 days ago

We should support login with arbitrary address within our UI in read only. Instead of using WalletConnect and https://guest.so, we could made this feature available with simply an input in the log in modal. Ideally we should also have a route to login user directly like https://snapshot.box/login/0xeF8305E140ac520225DAf050e2f71d5fBcC543e7 that redirect to /#/home

You can use Ethers.js Provider to initiate an connexion with a custom address for read functions.

Duplicate: https://github.com/snapshot-labs/workflow/issues/225

yehia67 commented 5 days ago

Hi @bonustrack 👋 May I help on this?

bonustrack commented 5 days ago

@yehia67 Sure go for it!

yehia67 commented 5 days ago

Thanks! on it 🏃‍♂️

yehia67 commented 4 days ago

@bonustrack may you please update the workflow link https://github.com/snapshot-labs/workflow/issues/225 It gave me 404, But I guess I understand the flow

  1. A new input will be added to the login modal.
  2. User set any Ethereum address.
  3. Using Ethers.js I fetch some data from this profile and redirect the user to the read-only mode. Is that correct?
bonustrack commented 4 days ago

@yehia67 There isn't more info available there: https://github.com/snapshot-labs/workflow/issues/225, if you need anything you can ask here.

For the flow that's correct, you'll need to propose a design that match with the app, reusing existing components as much as possible.

For the step 3, there is already logic to fetch data for a profile, you just need to connect a Web3Provider from Ethers.js as read only.