Skip to content

Commit

Permalink
Frontend using display name now when available
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Sep 21, 2023
1 parent cbbe417 commit 242bebd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/api/models/UserInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const LoginButton: React.FC<LoginButtonProps> = (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 {
Expand Down

0 comments on commit 242bebd

Please sign in to comment.