diff --git a/src/DesktopHeader.jsx b/src/DesktopHeader.jsx
index 8bd142fb9..61486776a 100644
--- a/src/DesktopHeader.jsx
+++ b/src/DesktopHeader.jsx
@@ -77,6 +77,7 @@ class DesktopHeader extends React.Component {
userMenu,
avatar,
username,
+ name,
intl,
} = this.props;
@@ -88,7 +89,7 @@ class DesktopHeader extends React.Component {
className="btn btn-outline-primary d-inline-flex align-items-center pl-2 pr-3"
>
- {username}
+ {name || username}
{userMenu.map(({ type, href, content }) => (
@@ -178,6 +179,7 @@ DesktopHeader.propTypes = {
logoDestination: PropTypes.string,
avatar: PropTypes.string,
username: PropTypes.string,
+ name: PropTypes.string,
loggedIn: PropTypes.bool,
// i18n
@@ -207,6 +209,7 @@ DesktopHeader.defaultProps = {
logoDestination: null,
avatar: null,
username: null,
+ name: null,
loggedIn: false,
appMenu: null,
};
diff --git a/src/Header.jsx b/src/Header.jsx
index c0db257c7..b7fbd37da 100644
--- a/src/Header.jsx
+++ b/src/Header.jsx
@@ -94,6 +94,7 @@ const Header = ({ intl }) => {
logoDestination: `${config.LMS_BASE_URL}/dashboard`,
loggedIn: authenticatedUser !== null,
username: authenticatedUser !== null ? authenticatedUser.username : null,
+ name: authenticatedUser !== null ? authenticatedUser.name : null,
avatar: authenticatedUser !== null ? authenticatedUser.avatar : null,
mainMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : mainMenu,
userMenu: getConfig().AUTHN_MINIMAL_HEADER ? [] : userMenu,
diff --git a/src/MobileHeader.jsx b/src/MobileHeader.jsx
index 506deb33d..7a40c62ac 100644
--- a/src/MobileHeader.jsx
+++ b/src/MobileHeader.jsx
@@ -89,6 +89,7 @@ class MobileHeader extends React.Component {
loggedIn,
avatar,
username,
+ name,
stickyOnMobile,
intl,
mainMenu,
@@ -139,7 +140,7 @@ class MobileHeader extends React.Component {
aria-label={intl.formatMessage(messages['header.label.account.menu'])}
title={intl.formatMessage(messages['header.label.account.menu'])}
>
-
+
{loggedIn ? this.renderUserMenuItems() : this.renderLoggedOutItems()}
@@ -173,6 +174,7 @@ MobileHeader.propTypes = {
logoDestination: PropTypes.string,
avatar: PropTypes.string,
username: PropTypes.string,
+ name: PropTypes.string,
loggedIn: PropTypes.bool,
stickyOnMobile: PropTypes.bool,
@@ -189,6 +191,7 @@ MobileHeader.defaultProps = {
logoDestination: null,
avatar: null,
username: null,
+ name: null,
loggedIn: false,
stickyOnMobile: true,