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

Clean up cancelled RP IDs if no filtered credentials #2822

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

lmuntaner
Copy link
Collaborator

@lmuntaner lmuntaner commented Jan 28, 2025

Motivation

We were adding domains as cancelled when the user closed the webauthn modal. We were assuming that was because the RP ID was incorrect.

However, there is the edge case that the RP ID is correct and the user cancelled manually. We can't differentiate both cancels.

In this PR, we clean up the cancelled RP IDs if there are no credentials for the remaining origins.

Changes

  • Add a check before calling findWebAuthnRpId to clean up the persisted storage and the local variables.

Tests

  • Added a unit test for it and changed the expectation for another one.
  • See screenshot for the UX.

🟡 Some screens were changed

@lmuntaner
Copy link
Collaborator Author

Before this fix, the user would get stuck, being sent to an error page until they clean up the browser storage.

New UX:

Screen.Recording.2025-01-28.at.16.18.53.mov

@lmuntaner lmuntaner marked this pull request as ready for review January 28, 2025 15:52
@lmuntaner lmuntaner requested a review from sea-snake January 28, 2025 15:52
@lmuntaner
Copy link
Collaborator Author

@sea-snake please review

@lmuntaner lmuntaner added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit 34ce099 Jan 29, 2025
67 checks passed
@lmuntaner lmuntaner deleted the lm-rotate-cancelled-rp-ids branch January 29, 2025 20:39
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