Skip to content

Commit 2a54403

Browse files
committed
fix(platform-objects): hide sys_user 2FA display when twoFactor is off
Drop two_factor_enabled from the highlights chip and the all_users / me list columns, retire the two_factor list view, and gate the Security tab's 2FA block (now also showing the state) on features.twoFactor. Regenerate the platform-objects translation bundles. Claude-Session: https://claude.ai/code/session_01Ukg7cK1DZiCfUdo5FH4G7A Co-authored-by: Claude <noreply@anthropic.com>
1 parent c362f96 commit 2a54403

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
fix: the `sys_user` page and list views show no 2FA state on a deployment where two-factor authentication is off
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`plugin-auth` resolves `twoFactor` to `false` unless a deployment turns it on, and `/api/v1/auth/config` then serves `features.twoFactor: false`. The platform's own `sys_user` declarations showed a 2FA state anyway, with no way to act on it: a "Two-Factor Enabled: No" highlights chip, a 2FA column in the `all_users` and `me` list views, a "2FA Enabled" view tab that could only ever be empty, and a Security-tab "Two-Factor Authentication" heading above an empty action bar.
11+
12+
- **Record page, Security tab:** the 2FA heading, its caption, the 2FA actions and the divider that closes the block carry one component `visibleWhen`, `has(features.twoFactor) && features.twoFactor == true`. With 2FA off, or before the auth config has loaded, the block is not drawn. With 2FA on, the block also shows the user's 2FA state (`two_factor_enabled`) beside the enable, disable and backup-code actions.
13+
- **Record page, highlights:** `two_factor_enabled` is no longer a highlight chip. A highlight field has no per-field gate, so the state moved into the gated Security block. The details grid still hides the field.
14+
- **List views:** `all_users` and `me` drop the `two_factor_enabled` column, and the `two_factor` ("2FA Enabled") list view is retired. A list column or view has no feature gate, and adding one would be a new authorable key.
15+
16+
The `two_factor_enabled` field itself is unchanged. A deployment with 2FA on that wants the column back can add it to its own list view.

‎packages/platform-objects/src/apps/translations/en.objects.generated.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
131131
unverified: {
132132
label: "Unverified"
133133
},
134-
two_factor: {
135-
label: "2FA Enabled"
136-
},
137134
banned: {
138135
label: "Banned"
139136
}

‎packages/platform-objects/src/apps/translations/es-ES.objects.generated.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
131131
unverified: {
132132
label: "No verificados"
133133
},
134-
two_factor: {
135-
label: "2FA habilitado"
136-
},
137134
banned: {
138135
label: "Bloqueado"
139136
}

‎packages/platform-objects/src/apps/translations/ja-JP.objects.generated.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
131131
unverified: {
132132
label: "未確認"
133133
},
134-
two_factor: {
135-
label: "2FA 有効"
136-
},
137134
banned: {
138135
label: "利用停止"
139136
}

‎packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
131131
unverified: {
132132
label: "未验证"
133133
},
134-
two_factor: {
135-
label: "已启用 2FA"
136-
},
137134
banned: {
138135
label: "已封禁"
139136
}

0 commit comments

Comments
 (0)