Skip to content
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

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

frederikrothenberger
Copy link
Member

@frederikrothenberger frederikrothenberger commented Aug 29, 2024

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.

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.
Copy link
Collaborator

@lmuntaner lmuntaner left a 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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the id?

Copy link
Member Author

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),
Copy link
Collaborator

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(
Copy link
Collaborator

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?

@frederikrothenberger frederikrothenberger added this pull request to the merge queue Aug 30, 2024
Merged via the queue into main with commit fd5486a Aug 30, 2024
66 checks passed
@frederikrothenberger frederikrothenberger deleted the frederik/last_used_principal branch August 30, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants