Skip to content

Account selection when authorizing a website#1068

Merged
jacogr merged 21 commits intopolkadot-js:masterfrom
Tbaut:tbaut-auth-per-account
Jul 14, 2022
Merged

Account selection when authorizing a website#1068
jacogr merged 21 commits intopolkadot-js:masterfrom
Tbaut:tbaut-auth-per-account

Conversation

@Tbaut
Copy link
Copy Markdown
Contributor

@Tbaut Tbaut commented May 17, 2022

closes #1037

  • account selection
  • un/toggle all accounts
  • show a dedicated message when no account was found: screenshot
  • refactor the website management screen to allow changing the connected accounts

It looks like this:

pjs-auth.mp4
website-management.mp4

TODO:

  • Show helper text & button when the extension doesn't have any account yet.
  • Fix the FIXME
  • Fix/Add tests
  • Add account management per website from the "Manage Website Access" screen.
  • Testing on FF and with less accounts
  • When an account is forgotten, we need to go through the list of authorized website and remove the said account.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented May 19, 2022

This pull request introduces 1 alert when merging 671a95b into 885a67e - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@Tbaut
Copy link
Copy Markdown
Contributor Author

Tbaut commented May 19, 2022

I'm on the fence regarding an edge case:

  • you have an account that is set as visible (eye open)
  • you select it to connect to a website
    -> the dapp has access to it
  • now you set it to invisible (eye closes)
    -> the dapp doesn't have access to it, as expected
    -> now because it's set as invisible, this account isn't listed in the accounts management any more, so that you can't actually remove it from the authorized accounts. Also the UI is inconsistent
    example screenshot

This contradicts what we discussed earlier here. I'm leaning toward still showing the hidden accounts in the AccountSelection, and show their global visibility status. What do you think?

edit: I went ahead and implement what makes the most sense to me, so that we don't have any inconsistent UI, but also hide the accounts with a closed eye as much as possible.

TL;DR:

  • on the Auth screen hidden accounts aren't visible, there's now a test for this.
  • on the Account management screen they are visible, along with the eye open/close action.

@Tbaut Tbaut marked this pull request as ready for review May 19, 2022 16:15
@Tbaut
Copy link
Copy Markdown
Contributor Author

Tbaut commented May 31, 2022

I'm pretty sure you've seen this @jacogr, but just in case pinging you here as it's ready to review.

@jacogr
Copy link
Copy Markdown
Member

jacogr commented Jun 6, 2022

Sorry, just wanted to get a release out (which overran by 10 days), before merging more code. Since we have https://github.com/polkadot-js/extension/releases/tag/v0.44.1, will take a peek as soon as I'm certain it is on the stores.

@Tbaut
Copy link
Copy Markdown
Contributor Author

Tbaut commented Jun 6, 2022

No problem at all, 100% what I thought, better get this tested well rather than rushed before a release 👍

@jacogr
Copy link
Copy Markdown
Member

jacogr commented Jun 10, 2022

Ok - 0.44.1 is on all stores, now back to normality. Will get to this soon.

@jonasW3F
Copy link
Copy Markdown

jonasW3F commented Jul 2, 2022

Looking forward to see this implemented! Is there any ETA on when this ships?

Copy link
Copy Markdown
Member

@jacogr jacogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to merge master? On my side I get build failures atm, e.g

    ./src/page.ts + 31 modules 29.6 KiB [built] [code generated]
  crypto (ignored) 15 bytes [built] [code generated]
  crypto (ignored) 15 bytes [built] [code generated]
  buffer (ignored) 15 bytes [optional] [built] [code generated]
  crypto (ignored) 15 bytes [built] [code generated]
webpack 5.73.0 compiled successfully in 4097 ms

*** @polkadot/extension-base 0.44.2-4
Successfully compiled 31 files with Babel (520ms).
Successfully compiled 31 files with Babel (143ms).
TypeError: Cannot read properties of undefined (reading 'startsWith')
    at relativePath (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:70:19)
    at createMapEntry (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:75:12)
    at buildExports (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:228:23)
    at file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:614:50
    at timeIt (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:565:3)
    at buildJs (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:614:7)
    at async main (file:///Users/jacogr/Projects/polkadotjs/test/tbaut-ext/node_modules/@polkadot/dev/scripts/polkadot-dev-build-ts.mjs:661:5)

I think this is maybe something to do with versions?

@Tbaut
Copy link
Copy Markdown
Contributor Author

Tbaut commented Jul 12, 2022

sure I'll check it out

@Tbaut
Copy link
Copy Markdown
Contributor Author

Tbaut commented Jul 12, 2022

I was able to build it without issue. lmk if you still run into troubles.

@jacogr
Copy link
Copy Markdown
Member

jacogr commented Jul 12, 2022

Yes, for me - master builds, this branch has issues. It seems to be caused by the dev scripts and have no idea why. (No changes here would cause anything weird). O, god, seems to be one of my issues caused by something I did somewhere, but has me stumped. (Whacked node_ modules and have the same issue)

@jacogr
Copy link
Copy Markdown
Member

jacogr commented Jul 12, 2022

Ok, this is not your issue.... local problem :( fuckit.

Copy link
Copy Markdown
Member

@jacogr jacogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine. I played with this over the last couple of days.

I'm not 100% convinced around the visible/invisible handling - I would probably have gone for the (more complicated option) or deleting it from all, like we handle deletes, when made invisible. But is is certainly an edge-case, as indicated.

@jacogr jacogr merged commit 00aa001 into polkadot-js:master Jul 14, 2022
@Tbaut Tbaut deleted the tbaut-auth-per-account branch July 14, 2022 09:48
@polkadot-js-bot
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance account visibility management - authorization per account and per website

4 participants