Skip to content

Commit

Permalink
patcches user section of admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
xwilson03 committed Aug 14, 2024
1 parent 6b620f9 commit 6cd422a
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions apps/web/src/components/admin/users/ServerSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,21 @@ export function ProfileInfo({ user }: { user: UserWithAllData }) {
}

export async function AccountInfo({ user }: { user: UserWithAllData }) {
const clerkUser = await clerkClient.users.getUser(user.clerkID);
if (!clerkUser) return null;

// const signInMethods = clerkUser.externalAccounts.map((account) =>
// titleCase(account.provider.split("_").slice(-1)[0])
// );

// if (clerkUser.passwordEnabled) {
// signInMethods.push("Password");
// }
const clerkUser = await clerkClient.users.getUser(user.clerkID).catch(() => {});

return (
<UserInfoSection title="Account Info">
<div className="flex flex-wrap gap-x-10 gap-y-5">
<Cell title="Email" value={user.email} />
<Cell title="Clerk ID" value={user.clerkID} />
{/* <Cell
title={`Sign-in Method${signInMethods.length > 1 ? "s" : ""}`}
value={signInMethods.join(", ")}
/> */}
{ clerkUser ?
<>
<Cell title="Email" value={user.email} />
<Cell title="Clerk ID" value={user.clerkID} />
</>
:
<div className="text-yellow-500">
Failed to find Clerk authentication data.
</div>
}
</div>
</UserInfoSection>
);
Expand Down

0 comments on commit 6cd422a

Please sign in to comment.