-
Notifications
You must be signed in to change notification settings - Fork 433
feat(ui): Hide "Remove" action for last second factor strategy when required #7729
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
base: main
Are you sure you want to change the base?
feat(ui): Hide "Remove" action for last second factor strategy when required #7729
Conversation
- Added logic to hide the "Remove" action for the last available second factor when MFA is required. - Updated UserSettings and MfaSection components to support MFA requirements. - Enhanced tests to verify the visibility of delete actions based on MFA status.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f01aa62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughThis change introduces MFA requirement configuration and updates UI logic to conditionally hide delete actions for multi-factor authentication strategies. A new 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@packages/ui/src/components/UserProfile/__tests__/MfaPage.test.tsx`:
- Around line 506-538: The test "shows phone code delete action when TOTP is
also available" is missing the MFA-required fixture; update the createFixtures
callback to call f.withMfaRequired(true) alongside the existing
f.withPhoneNumber, f.withAuthenticatorApp, and f.withUser calls so the test runs
in the MFA-required scenario and properly asserts the delete action visibility
for phone codes when TOTP is enabled.
In `@packages/ui/src/components/UserProfile/MfaSection.tsx`:
- Around line 188-191: Remove the debug console.log statements that print
actions, hidePhoneCodeDeleteAction, and isDefault in the MfaSection component;
locate the logs in packages/ui/src/components/UserProfile/MfaSection.tsx (inside
the MfaSection function/render logic where those variables are referenced) and
delete the three console.log lines so no debug output is emitted in production.
Description
This PR hides the "Remove" action from the last 2nd factor authentication strategy in
<UserProfile/>security page, when multi-factor requirement is enabled.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Bug Fixes
New Behavior
Tests