Skip to content

web/flow: reset stale authenticator selection between consecutive validate stages#20802

Merged
GirlBossRush merged 5 commits intogoauthentik:mainfrom
Oluwatobi-Mustapha:fix/mfa-autoselect-stage-scope-14941
Mar 19, 2026
Merged

web/flow: reset stale authenticator selection between consecutive validate stages#20802
GirlBossRush merged 5 commits intogoauthentik:mainfrom
Oluwatobi-Mustapha:fix/mfa-autoselect-stage-scope-14941

Conversation

@Oluwatobi-Mustapha
Copy link
Contributor

@Oluwatobi-Mustapha Oluwatobi-Mustapha commented Mar 9, 2026

Fixes #14941

When the authenticator-validate stage component is reused across consecutive MFA stages, the previous selected challenge can persist into the next stage even if that challenge is no longer allowed.

This change resets the selected challenge when challenge updates and the previous selection is not present in the new deviceChallenges set, then re-runs the existing auto-selection initialization path for the new challenge.

Also adds unit coverage for stale-selection reset behavior.

@Oluwatobi-Mustapha Oluwatobi-Mustapha requested a review from a team as a code owner March 9, 2026 10:59
@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 3975722
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/69bc03e0e9491f000876ee0f
😎 Deploy Preview https://deploy-preview-20802--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 3975722
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/69bc03e08141300007d0ccbe
😎 Deploy Preview https://deploy-preview-20802--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 87c4a8a
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69aea818142cf20008f94a2b
😎 Deploy Preview https://deploy-preview-20802--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 9, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 3975722
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69bc03e03001f80007d69c33
😎 Deploy Preview https://deploy-preview-20802--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (25d3d57) to head (3975722).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20802      +/-   ##
==========================================
- Coverage   93.49%   93.44%   -0.05%     
==========================================
  Files         993      993              
  Lines       56146    56146              
==========================================
- Hits        52491    52468      -23     
- Misses       3655     3678      +23     
Flag Coverage Δ
conformance 37.33% <ø> (-0.06%) ⬇️
e2e 42.89% <ø> (+<0.01%) ⬆️
integration 22.16% <ø> (-0.05%) ⬇️
unit 91.69% <ø> (+<0.01%) ⬆️
unit-migrate 91.79% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@GirlBossRush GirlBossRush self-requested a review March 9, 2026 15:36
@GirlBossRush GirlBossRush force-pushed the fix/mfa-autoselect-stage-scope-14941 branch from d3b5189 to 6782464 Compare March 9, 2026 17:10
@GirlBossRush GirlBossRush added the area:frontend Features or issues related to the browser, TypeScript, Node.js, etc label Mar 9, 2026
@GirlBossRush GirlBossRush self-assigned this Mar 9, 2026
@GirlBossRush GirlBossRush added the backport/version-2026.2 Add this label to PRs to backport changes to version-2026.2 label Mar 9, 2026
@GirlBossRush GirlBossRush force-pushed the fix/mfa-autoselect-stage-scope-14941 branch from fbb4cb9 to 3975722 Compare March 19, 2026 14:10
@GirlBossRush
Copy link
Contributor

@Oluwatobi-Mustapha Thank you sending such a detailed PR! 🥂

The changes here look great and align with an ongoing effort to make the flow stages easier to test and reason about. I can merge this now and the changes should appear in the next release, as well as our next patch release of 2026.2

@GirlBossRush GirlBossRush merged commit a10ec34 into goauthentik:main Mar 19, 2026
101 checks passed
authentik-automation bot pushed a commit that referenced this pull request Mar 19, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #20802
Original commit: a10ec34
@authentik-automation
Copy link
Contributor

⚠️ Cherry-pick to version-2026.2 has conflicts: #21014

GirlBossRush pushed a commit that referenced this pull request Mar 20, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #20802
Original commit: a10ec34
kensternberg-authentik added a commit that referenced this pull request Mar 24, 2026
* main:
  web: link file picker to docs (#20995)
  web/flow: reset stale authenticator selection between consecutive validate stages (#20802)
  ci: bump actions/cache from 5.0.3 to 5.0.4 (#21002)
  root: init rust workspace (#20983)
  website/docs: fix swapped sidebar label (#21011)
  core: bump goauthentik/fips-python from `ec5c4cd` to `859ad57` in /lifecycle/container (#21003)
  core: bump goauthentik/fips-debian from `a613b75` to `7baeeaa` in /lifecycle/container (#21001)
  core: bump djangorestframework from 3.16.1 to 3.17.0 (#21000)
  lifecycle/aws: bump aws-cdk from 2.1111.0 to 2.1112.0 in /lifecycle/aws (#20999)
  ci: bump codecov/codecov-action from 5.5.2 to 5.5.3 in /.github/actions/test-results (#21004)
  web: bump the storybook group across 1 directory with 5 updates (#21005)
  web: bump knip from 5.87.0 to 5.88.0 in /web (#21006)
  web: bump @formatjs/intl-listformat from 8.2.3 to 8.3.1 in /web (#21007)
  website/docs: update kubernetes install guide for Gateway API (#20961)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2026.2 Add this label to PRs to backport changes to version-2026.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Available MFA device is not shown properly

3 participants