From 242bebdf7671156df51e1a475aba1043dc68ab38 Mon Sep 17 00:00:00 2001 From: Ruben Thoms Date: Thu, 21 Sep 2023 18:20:42 +0200 Subject: [PATCH] Frontend using display name now when available --- frontend/src/api/models/UserInfo.ts | 1 + .../framework/internal/components/LoginButton/loginButton.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/models/UserInfo.ts b/frontend/src/api/models/UserInfo.ts index bc2dc25c9..efffcd292 100644 --- a/frontend/src/api/models/UserInfo.ts +++ b/frontend/src/api/models/UserInfo.ts @@ -4,6 +4,7 @@ export type UserInfo = { username: string; + display_name: (string | null); avatar_b64str: (string | null); has_sumo_access: boolean; has_smda_access: boolean; diff --git a/frontend/src/framework/internal/components/LoginButton/loginButton.tsx b/frontend/src/framework/internal/components/LoginButton/loginButton.tsx index 7d13f6e14..427327f9b 100644 --- a/frontend/src/framework/internal/components/LoginButton/loginButton.tsx +++ b/frontend/src/framework/internal/components/LoginButton/loginButton.tsx @@ -49,7 +49,7 @@ export const LoginButton: React.FC = (props) => { function makeText() { if (authState === AuthState.LoggedIn) { - return userInfo?.username || "Unknown user"; + return userInfo?.display_name || userInfo?.username || "Unknown user"; } else if (authState === AuthState.NotLoggedIn) { return "Sign in"; } else {