Skip to content

Commit 162e998

Browse files
committed
feat: add oidc provider
Signed-off-by: Rafael Silva (rafaelsi) <rafaelsi@cisco.com>
1 parent 046bcb3 commit 162e998

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

frontend/src/components/dashboard/welcome-name.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
*/
55

66
import {useAuth, useWindowSize} from '@/hooks';
7+
import {cn} from '@/lib/utils';
8+
import {isMultiTenant} from '@/utils/get-auth-config';
79
import {Typography} from '@open-ui-kit/core';
810

911
export const WelcomeName = () => {
1012
const {authInfo} = useAuth();
1113
const {isMobile} = useWindowSize();
14+
const isMulti = isMultiTenant();
1215
return (
1316
<div className="bg-[#00142B] h-full">
1417
<div className="w-full h-[200px] md:h-[184px] flex flex-col justify-between sticky top-0 z-0">
@@ -19,7 +22,10 @@ export const WelcomeName = () => {
1922
textAlign="center"
2023
sx={(theme) => ({color: theme.palette.vars.brandIconTertiaryDefault})}
2124
>
22-
Welcome to Agent Identity Service, <span className="capitalize">{authInfo?.user?.name || 'User'}!</span>
25+
Welcome to Agent Identity Service,{' '}
26+
<span className={cn(isMulti && 'capitalize')}>
27+
{authInfo?.user?.name || authInfo?.user?.username || 'User'}!
28+
</span>
2329
</Typography>
2430
<Typography
2531
variant={isMobile ? 'body2' : 'body1'}

frontend/src/components/layout/header.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {useGetDevices} from '@/queries';
2121
import {GlobalSearch} from '../shared/helpers/global-search';
2222
import Logo from '@/assets/header/header.svg?react';
2323
import {globalConfig} from '@/config/global';
24+
import {cn} from '@/lib/utils';
25+
import {isMultiTenant} from '@/utils/get-auth-config';
2426

2527
export const Header = () => {
2628
const {isMobile} = useWindowSize();
@@ -98,6 +100,7 @@ const UserSection = ({
98100
const open = Boolean(anchorEl);
99101

100102
const {isMobile} = useWindowSize();
103+
const isMulti = isMultiTenant();
101104

102105
const navigate = useNavigate();
103106
const {authInfo, logout} = useAuth();
@@ -167,7 +170,7 @@ const UserSection = ({
167170
>
168171
<div className="text-left hidden md:block">
169172
<Typography variant="subtitle2" sx={(theme) => ({color: theme.palette.vars.baseTextStrong})}>
170-
<span className="capitalize">{authInfo?.user?.name || 'User'}</span>
173+
<span className={cn(isMulti && 'capitalize')}>{authInfo?.user?.name || authInfo?.user?.username || 'User'}</span>
171174
</Typography>
172175
<div className="-mt-[3px]">
173176
<Typography
@@ -192,9 +195,11 @@ const UserSection = ({
192195
</div>
193196
<div className="text-center">
194197
<Typography variant="subtitle2" sx={(theme) => ({color: theme.palette.vars.baseTextStrong})}>
195-
<span className="capitalize">{authInfo?.user?.name || 'User'}</span>
198+
<span className={cn(isMulti && 'capitalize')}>
199+
{authInfo?.user?.name || authInfo?.user?.username || 'User'}
200+
</span>
196201
</Typography>
197-
<div className="-mt-[4px]">
202+
<div>
198203
<Typography
199204
variant="caption"
200205
sx={(theme) => ({

0 commit comments

Comments
 (0)