Skip to content

Commit

Permalink
Update src/Utils/AuthorizeFor.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad authored Jan 16, 2024
1 parent 35f4c58 commit e948335
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Utils/AuthorizeFor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ export const AuthorizeUserRoute: React.FC<AuthorizeUserRouteProps> = ({
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 <Error404 />;
Expand Down

0 comments on commit e948335

Please sign in to comment.