Skip to content

Conversation

@agiannelli-auth0
Copy link
Contributor

@agiannelli-auth0 agiannelli-auth0 commented Nov 14, 2025

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

For the case when getDefaultTenant throws an error, ensure login still functions correctly.

Prior to this fix, the backend changes cause the UI to not render the Profile dropdown due to missing tenants. This removes the dependency on having a tenant and only relies on having a User.

We hide the View Profile link as well as this link is not valid for noTenant users - it is simply #

Screenshot 2025-11-21 at 3 46 56 PM

References

https://auth0team.atlassian.net/browse/DXSUP-2736
https://github.com/atko-cic/docs-backend/pull/50

Testing

Local testing of site

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@agiannelli-auth0 agiannelli-auth0 self-assigned this Nov 14, 2025
@HVish HVish added main-docs Changes related to auth0's main docs (https://auth0.com/docs) and removed gen-ai labels Nov 17, 2025
@HVish
Copy link
Contributor

HVish commented Nov 17, 2025

@agiannelli-auth0 There's some extra white space below the logout button in the profile dropdown. Can we remove it?

@mikemimik
Copy link
Contributor

@claude

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

Claude finished @mikemimik's task —— View job


Code Review Complete

Overall Assessment

⚠️ This PR requires changes before merging. While the core functionality to support no-tenant users is implemented correctly, there are code quality issues and a UX concern that should be addressed.

Key Findings

Code Quality Issues:

  • Inconsistent spacing in className attributes (profile-menu.tsx:172)
  • Ternary expressions that should use short-circuit evaluation for better readability
  • Missing conditional rendering for the "Switch Tenant" menu item when no tenant is available

Functional Concern:

  • The "Switch Tenant" button may be displayed even when onSwitchTenant is undefined, which could lead to a non-functional UI element. The button should be conditionally rendered based on callback availability.

Outstanding Issue:

  • The whitespace issue below the logout button mentioned by @HVish appears to stem from the parent container's padding structure (line 127: adu:py-2), but I couldn't create an inline comment on the logout button due to diff limitations. This should be investigated and fixed.

What Works Well

✅ The core logic for handling no-tenant users is sound:

  • Properly hides "View Profile" link when profileUrl === "#"
  • Shows appropriate messaging when no tenant is available
  • Maintains user authentication flow without requiring a tenant
  • Removes dependency on tenant existence for profile dropdown rendering

Recommendations

  1. Fix the className spacing issue on line 172
  2. Add conditional rendering for the "Switch Tenant" menu item
  3. Investigate and resolve the whitespace issue below the logout button
  4. Consider extracting the magic string "#" to a constant

</a>
</ContentText>
</DropdownMenuItem>
<DropdownMenuItem onClick={onSwitchTenant}>

Choose a reason for hiding this comment

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

Code Quality: Conditional rendering should handle undefined callback

The onClick handler is passed onSwitchTenant which can be undefined based on the logic in auth-menu.tsx:227. When onSwitchTenant is undefined, this menu item should not be rendered at all:

Suggested change
<DropdownMenuItem onClick={onSwitchTenant}>
{onSwitchTenant && <DropdownMenuItem onClick={onSwitchTenant}>
<SvgIcon iconName="refresh" className="adu:mr-2" />
<ContentText
className="adu:text-foreground-bold"
variant="text-sm-bold"
>
Switch Tenant
</ContentText>
<SvgIcon iconName="caret-right" className="adu:ml-auto" />
</DropdownMenuItem>}

This prevents showing a "Switch Tenant" option when there are no tenants available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main-docs Changes related to auth0's main docs (https://auth0.com/docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants