Skip to content

Commit

Permalink
✨(frontend) display email if no username
Browse files Browse the repository at this point in the history
Fallback to email if no username is defined for logged user.
  • Loading branch information
sdemagny committed Jan 11, 2025
1 parent 2428229 commit 4def802
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to

### Added

- ✨(frontend) display email if no username #562
- 🧑‍💻(oidc) add ability to pull registration ID (e.g. SIRET) from OIDC #577

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const AccountDropdown = () => {
const { t } = useTranslation();
const { userData, logout } = useAuthStore();

const userName = userData?.name || t('No Username');
const userName = userData?.name || userData?.email || t('No Username');
return (
<DropButton
button={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('AccountDropdown', () => {
});

renderAccountDropdown();
expect(screen.getByText('No Username')).toBeInTheDocument();
expect(screen.getByText('[email protected]')).toBeInTheDocument();
});

it('opens the dropdown and shows logout button when clicked', async () => {
Expand Down

0 comments on commit 4def802

Please sign in to comment.