Skip to content

Commit 403d074

Browse files
fix: Authentication Not Enforced, Resulting in Identity Provider Errors (#742)
* apiFixFrontend * new * new1
1 parent eebfd10 commit 403d074

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/frontend/src/components/SidebarView/SidebarView.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ export const SidebarView = (): JSX.Element => {
3939

4040
useEffect(() => {
4141
getUserInfo().then((res) => {
42-
const name: string = res[0].user_claims.find((claim: any) => claim.typ === 'name')?.val ?? ''
43-
setName(name)
42+
if (res && res.length > 0 && res[0].user_claims) {
43+
const name: string = res[0].user_claims.find((claim: any) => claim.typ === 'name')?.val ?? ''
44+
setName(name)
45+
}
4446
}).catch((err) => {
4547
console.error('Error fetching user info: ', err)
4648
})

0 commit comments

Comments
 (0)