-
Notifications
You must be signed in to change notification settings - Fork 30
fix: profile with no tenants #287
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?
Conversation
|
@agiannelli-auth0 There's some extra white space below the logout button in the profile dropdown. Can we remove it? |
|
Claude finished @mikemimik's task —— View job Code Review CompleteOverall AssessmentKey FindingsCode Quality Issues:
Functional Concern:
Outstanding Issue:
What Works Well✅ The core logic for handling no-tenant users is sound:
Recommendations
|
| </a> | ||
| </ContentText> | ||
| </DropdownMenuItem> | ||
| <DropdownMenuItem onClick={onSwitchTenant}> |
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.
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:
| <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.
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
#References
https://auth0team.atlassian.net/browse/DXSUP-2736
https://github.com/atko-cic/docs-backend/pull/50
Testing
Local testing of site
Checklist