refactor: update user and authentication schema with two-factor support

This commit is contained in:
Mauricio Siu
2025-02-16 15:32:57 -06:00
parent 90156da570
commit e1632cbdb3
33 changed files with 657 additions and 180 deletions

View File

@@ -52,7 +52,7 @@ interface Props {
export const AddUserPermissions = ({ userId }: Props) => {
const { data: projects } = api.project.all.useQuery();
const { data, refetch } = api.user.byUserId.useQuery(
const { data, refetch } = api.auth.one.useQuery(
{
userId,
},
@@ -92,7 +92,7 @@ export const AddUserPermissions = ({ userId }: Props) => {
const onSubmit = async (data: AddPermissions) => {
await mutateAsync({
userId,
id: userId,
canCreateServices: data.canCreateServices,
canCreateProjects: data.canCreateProjects,
canDeleteServices: data.canDeleteServices,

View File

@@ -104,9 +104,9 @@ export const ShowUsers = () => {
</Badge>
</TableCell>
<TableCell className="text-center">
{user.user.is2FAEnabled
{/* {user.user.is2FAEnabled
? "2FA Enabled"
: "2FA Not Enabled"}
: "2FA Not Enabled"} */}
</TableCell>
{/* <TableCell className="text-right">
<span className="text-sm text-muted-foreground">
@@ -156,7 +156,7 @@ export const ShowUsers = () => {
/>
)} */}
{user.role !== "owner" && (
{/* {user.role !== "owner" && (
<DialogAction
title="Delete User"
description="Are you sure you want to delete this user?"
@@ -185,7 +185,7 @@ export const ShowUsers = () => {
Delete User
</DropdownMenuItem>
</DialogAction>
)}
)} */}
</DropdownMenuContent>
</DropdownMenu>
</TableCell>