Skip to content

Commit

Permalink
auth fix
Browse files Browse the repository at this point in the history
  • Loading branch information
armintalaie committed Sep 28, 2024
1 parent c4c88d0 commit be0a557
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/portal/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export default function Layout({ children }: { children: React.ReactNode }) {
if (!user) {
redirect("/auth");
}


if (
!userMetadata ||
!userMetadata.roles ||
Expand Down
2 changes: 1 addition & 1 deletion src/app/portal/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function getUserMetadata(id: string) {
});
const [roles, member] = await Promise.all([rolesP, memberP]);
return {
roles: roles,
roles: roles?.roles,
member: member,
};
}
Expand Down

0 comments on commit be0a557

Please sign in to comment.