w3c-fedid / FedCM

A privacy preserving identity exchange Web API
https://w3c-fedid.github.io/FedCM/
Other
375 stars 72 forks source link

Returning accounts go first in getUserInfo #483

Open npm1 opened 1 year ago

npm1 commented 1 year ago

This PR fixes the order of returned accounts in getUserInfo(). The returning list should list the returning accounts first, and then all the remaining accounts.

Fixes https://github.com/fedidcg/FedCM/issues/625


Preview | Diff

npm1 commented 1 year ago

@bvandersloot-mozilla please take a look

npm1 commented 1 year ago

Ping

npm1 commented 9 months ago

I noticed this PR is still relevant. Rebased since it was pretty old but still want to merge this. Anyone have any further comments?

npm1 commented 2 months ago

Computing a secret bit and using it to re-sort a list returned to the webpage is not a good pattern. If we are going to alter the output, it should at least be observable why. This is hard to work with. Is accounts[0] previously used? accounts[n-1]?

The idea is that accounts[0] is previously used. @yi-gu do you remember why we do not expose whether an account is returning or not explicitly in this API? It's not clear to me.

bvandersloot-mozilla commented 2 months ago

The idea is that accounts[0] is previously used. But you can't guarantee that.

npm1 commented 2 months ago

The idea is that accounts[0] is previously used. But you can't guarantee that.

You can. getUserInfo only returns anything if there are returning accounts. And we surface returning accounts first, followed by other accounts. So accounts[0] is a returning account.