Skip to content

Indicate that local user auth is disabled#551

Merged
braginini merged 2 commits intomainfrom
feature/indicate-local-auth-disabled
Feb 12, 2026
Merged

Indicate that local user auth is disabled#551
braginini merged 2 commits intomainfrom
feature/indicate-local-auth-disabled

Conversation

@braginini
Copy link
Copy Markdown
Contributor

@braginini braginini commented Feb 12, 2026

Screenshot 2026-02-12 at 12 15 03

Summary by CodeRabbit

Release Notes

  • New Features
    • Shows "Disabled" account status when local authentication is turned off.
    • Contextual tooltip content that displays either a local-auth disabled notice (with Learn more) or user approval guidance (with Settings and help links).
    • Tooltip and help icon now appear only when relevant (disabled auth or pending approval).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The UserStatusCell component now reads account settings to detect when local authentication is disabled for local-IDP users, displays "Disabled" status with gray styling, and shows context-sensitive tooltip content (local-auth-disabled notice or approval guidance) and help icon only when relevant.

Changes

Cohort / File(s) Summary
User Status Cell UI
src/modules/users/table-cells/UserStatusCell.tsx
Integrated account hook to derive isLocalAuthDisabled; added Disabled status display and gray styling for local-disabled users; replaced static tooltip with tooltipContent that switches between local-auth-disabled message (with Learn more link) and pending-approval guidance (with Settings and User Approval links); tooltip and HelpCircle visibility now driven by showTooltip.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mlsmaycon
  • heisbrot

Poem

🐇 I peeked at settings, found the key,
Local auth snoozed — now we clearly see.
A gray "Disabled" badge, tooltip to guide,
Links to learn more, hop in with pride! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding UI indication when local user authentication is disabled in the UserStatusCell component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/indicate-local-auth-disabled

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/modules/users/table-cells/UserStatusCell.tsx`:
- Around line 17-19: The expression computing isLocalAuthDisabled can throw if
account is present but account.settings is undefined; update the guard to use
optional chaining on settings (e.g., change
account?.settings.local_auth_disabled to account?.settings?.local_auth_disabled)
so the boolean check is safe, and ensure the expression in UserStatusCell
(reference: isLocalAuthDisabled, account, settings, user.idp_id) still compares
to true and combines with user.idp_id === "local"; optionally verify the Account
type/interface to confirm settings is optional and adjust types if needed.
🧹 Nitpick comments (2)
src/modules/users/table-cells/UserStatusCell.tsx (2)

40-85: Tooltip content is computed on every render even when the tooltip is disabled.

When showTooltip is false, neither branch of the tooltip content is used, yet both JSX trees are still created. This isn't a performance concern for a small table, but for consistency you could compute tooltipContent only when needed.

♻️ Lazy computation
- const tooltipContent = isLocalAuthDisabled ? (
+ const tooltipContent = showTooltip ? (
+   isLocalAuthDisabled ? (
      <div className={"max-w-xs text-xs flex flex-col gap-2"}>
        ...
      </div>
-   ) : (
+   ) : (
      <div className={"max-w-xs text-xs flex flex-col gap-2"}>
        ...
      </div>
-   );
+   )
+ ) : null;

14-14: useAccount() is invoked per table row — relies on fetch-layer caching.

This hook is called once per UserStatusCell instance (i.e., once per user row). It works correctly only if the underlying data-fetching layer (e.g., SWR or React Query) deduplicates the /accounts request. This appears to be the case based on useFetchApi, but worth keeping in mind if this component is rendered in a large list.

Consider lifting the useAccount() call to the parent table component and passing account (or just isLocalAuthDisabled) as a prop to each cell. This avoids coupling every cell to the account context and makes the component easier to test.

#!/bin/bash
# Check how useFetchApi handles caching/deduplication
rg -n 'function useFetchApi' -A 20
rg -n 'useFetchApi' -C3 --type=ts

Comment thread src/modules/users/table-cells/UserStatusCell.tsx
@braginini braginini requested a review from heisbrot February 12, 2026 14:11
…sabled) so the expression safely evaluates to false instead of throwing if account.settings is

  undefined.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/modules/users/table-cells/UserStatusCell.tsx (1)

22-30: ⚠️ Potential issue | 🟡 Minor

isLocalAuthDisabled overrides the "Blocked" status — is this intentional?

If a local user has been explicitly blocked by an admin (status === "blocked") and local auth is also disabled, this logic shows "Disabled" instead of "Blocked". This could hide the admin's deliberate block action. Consider checking status === "blocked" first, or combining the information.

@braginini braginini merged commit 84c239c into main Feb 12, 2026
4 checks passed
@braginini braginini deleted the feature/indicate-local-auth-disabled branch February 12, 2026 14:16
@coderabbitai coderabbitai Bot mentioned this pull request Apr 16, 2026
2 tasks
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.

2 participants