regen-network / regen-web

:seedling: Website and marketplace application

Home Page:https://app.regen.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add and switch account based on the new multiple accounts session

blushi opened this issue · comments

Is your feature request related to a problem? Please describe.
We've updated how supporting multiple accounts authenticated work on the server side, it's now stored in the session cookie (instead of permanently in the database).

Describe the solution you'd like

  • As an authenticated user, if I click "+ add account" from the user dropdown, I should see our LoginModal with the different methods for logging in. Successfully logging in with one of these methods will automatically add the account to the current list of authenticated accounts.
  • As an authenticated user, I can switch to web2 authenticated accounts by clicking on it in the account dropdown. Technically, we should call the /POST /marketplace/v1/auth/accounts endpoint with the accountId as request params, which will update the active account id.
  • As an authenticated user, I can switch from a web2 account to a web3 authenticated account as long as this account corresponds to the account address set in Keplr.

Additional context (optional)
The following use cases are already implemented:

  • If a user is logged in with a keplr wallet address A and switch to address B from Keplr which is not part of the authenticated accounts, he will be prompted to sign the arbitrary transaction. If this is successful, the account with address B will be added to the authenticated accounts and set as the active account.
  • If a user is logged in with a keplr wallet address A and switch to address B from Keplr which is already part of the authenticated accounts, it should simply update the active account id

For Admin Use

  • Not duplicate issue
  • Appropriate labels and zenhub epics applied
  • Appropriate contributors tagged

@blushi You might have better visibility on the scope of this task, we can go with 3 if you think it's more accurate.

I was hesitating with a 5 so fine with a 5!