-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only allow the most recently used identity to be auto-selected #2579
Conversation
This is an enhancement to the auto-selection feature introduced in #2563: In order to not confuse users, only the most recently used identity can be auto-selected (i.e. when refreshing sessions). This way, a dapp cannot make a user _switch_ identities without them having the identity selected explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LBTM! Just a few comments
<button @click=${() => useExistingProps.register()} class="t-link"> | ||
<button | ||
@click=${() => useExistingProps.register()} | ||
id="registerButton" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the id there so that the e2e test button click logic for the register button works the same regardless of the template (firstTime
/ useExisting
).
); | ||
vi.useFakeTimers().setSystemTime(new Date(0)); | ||
await setKnownPrincipal({ | ||
userNumber: BigInt(10000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put BitInt(10000)
and BigInt(1000)
in variables to better read the expectations?
}) | ||
); | ||
|
||
test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test adding the principal in another origin?
This is an enhancement to the auto-selection feature introduced in #2563: In order to not confuse users, only the most recently used identity can be auto-selected (i.e. when refreshing sessions). This way, a dapp cannot make a user switch identities without them having the identity selected explicitly.