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

[PM-13932] Fix passkey flow incorrect routing #12363

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

rr-bw
Copy link
Contributor

@rr-bw rr-bw commented Dec 12, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13932

📔 Objective

This PR fixes a bug in the LockComponent refresh that affected the use and setup/save passkey flows.

Description of the bug: When a locked user attempts to sign in with a passkey on a website, when they unlock they are incorrectly navigated to their vault, rather than to the "Login with passkey" screen (the /fido2 route). This forces them to re-initiate the sign in with passkey flow on the website, at which point they can now access the passkey in Bitwarden since they are unlocked.

The correct flow is that when they unlock they should to be taken to the "Login with passkey" screen and allowed to use their passkey.

The fix for this involved three changes, which I've explained in a comment next to each of the code changes.

The two videos below show the before and after-fixed version of using a passkey. Note that I also tested the setting up/saving a passkey flow as well, and it works.

📸 Screenshots

🐞 Before (bug version)

before.mov

✅ After (fixed version)

after.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 33.37%. Comparing base (2da3043) to head (39dbe81).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...r/src/auth/functions/unauth-ui-refresh-redirect.ts 0.00% 0 Missing and 1 partial ⚠️
...bs/angular/src/utils/extension-refresh-redirect.ts 0.00% 0 Missing and 1 partial ⚠️
libs/auth/src/angular/lock/lock.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12363   +/-   ##
=======================================
  Coverage   33.36%   33.37%           
=======================================
  Files        2908     2908           
  Lines       90989    90990    +1     
  Branches    17328    17328           
=======================================
+ Hits        30363    30369    +6     
+ Misses      58223    58217    -6     
- Partials     2403     2404    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Dec 12, 2024

Logo
Checkmarx One – Scan Summary & Details6c2a8053-b4d0-413a-adc1-be0bf87dbce5

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/cli/src/commands/get.command.ts: 151 Attack Vector

@rr-bw rr-bw marked this pull request as ready for review December 12, 2024 08:32
@rr-bw rr-bw requested a review from a team as a code owner December 12, 2024 08:32
@rr-bw rr-bw requested a review from ike-kottlowski December 12, 2024 08:32
@JaredSnider-Bitwarden JaredSnider-Bitwarden removed the request for review from ike-kottlowski December 12, 2024 16:43
Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

Choose a reason for hiding this comment

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

Excellent work.

@rr-bw rr-bw merged commit 8ec7561 into main Dec 12, 2024
71 checks passed
@rr-bw rr-bw deleted the auth/pm-13932/bugfix-passkey-flow branch December 12, 2024 21:10
@quexten
Copy link
Contributor

quexten commented Dec 17, 2024

Has been already merged but excellent work! This also fixed https://bitwarden.atlassian.net/browse/PM-16116.

quexten pushed a commit that referenced this pull request Dec 18, 2024
This PR fixes a bug in the LockComponent refresh that affected the setup/save and use passkey flows. The user was wrongly directly to the /vault after unlock instead of to /fido2 (the passkey screen).

Feature Flag: ExtensionRefresh ON

(cherry picked from commit 8ec7561)
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.

3 participants