fix(settings): hide profile 2FA and delete account when AUTH_TYPE=SSO - #14
fix(settings): hide profile 2FA and delete account when AUTH_TYPE=SSO#14jawad-khan wants to merge 2 commits into
Conversation
|
All code-related CI jobs are passing ✅. The only failure is Preview Environment Dispatch — it fails because the The PR changes look correct — |
There was a problem hiding this comment.
Pull request overview
Updates the Profile settings page UI to better match SSO deployments by removing local-account security and lifecycle controls that don’t apply when authentication is owned by an external IdP.
Changes:
- Extracted the Profile “Two Factor Authentication” UI into a dedicated
ProfileTwoFactorAuthenticationSectioncomponent with an outer/inner SSO guard pattern. - Hid the Profile “Danger zone” (delete account / leave workspace) section when
AUTH_TYPE=SSO. - Simplified
SettingsProfileby removing inline TOTP status/link logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/twenty-front/src/pages/settings/SettingsProfile.tsx | Uses useIsSsoEnabled() to hide the delete/leave section under SSO and delegates Profile 2FA rendering to the new extracted component. |
| packages/twenty-front/src/modules/settings/profile/components/ProfileTwoFactorAuthenticationSection.tsx | New component that renders the Profile TOTP card when not SSO, and returns null under SSO (outer/inner guard). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const ProfileTwoFactorAuthenticationSection = () => { | ||
| const isSsoEnabled = useIsSsoEnabled(); | ||
|
|
||
| if (isSsoEnabled) { | ||
| return null; | ||
| } | ||
|
|
||
| return <ProfileTwoFactorAuthenticationSectionInner />; | ||
| }; |
Summary
AUTH_TYPE=SSO.ProfileTwoFactorAuthenticationSection, following the same outer/inner SSO guard pattern used byToggle2FAandSettingsTwoFactorAuthenticationMethod.Why
In SSO deployments, MFA and account lifecycle are owned by the identity provider. Showing Twenty's local TOTP setup and self-service account deletion on Profile is misleading — those controls don't participate in the actual login or provisioning flow.
This aligns Profile with existing SSO behavior:
Test plan
AUTH_TYPE=SSO, open Settings → Profile and confirm Two Factor Authentication and Danger zone are not shownAUTH_TYPEunset or non-SSO, confirm both sections still appearAUTH_TYPE=SSO, navigate directly to/settings/two-factor-authentication/totpand confirm redirect to Profile still works