diff --git a/src/Utils/AuthorizeFor.tsx b/src/Utils/AuthorizeFor.tsx index 38ca5fb4165..614325ddd25 100644 --- a/src/Utils/AuthorizeFor.tsx +++ b/src/Utils/AuthorizeFor.tsx @@ -40,9 +40,8 @@ export const AuthorizeUserRoute: React.FC = ({ userTypes, children, }) => { - const userData = useAuthUser(); - - if (userData && userTypes.includes(userData.user_type)) { + const authUser = useAuthUser(); + if (userTypes.includes(authUser.user_type)) { return <>{children}; } else { return ;