mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: add 2fa
This commit is contained in:
@@ -106,26 +106,25 @@ export const isAdminPresent = async () => {
|
||||
};
|
||||
|
||||
export const getUserByToken = async (token: string) => {
|
||||
// const user = await db.query.users.findFirst({
|
||||
// where: eq(users.token, token),
|
||||
// with: {
|
||||
// auth: {
|
||||
// columns: {
|
||||
// password: false,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// if (!user) {
|
||||
// throw new TRPCError({
|
||||
// code: "NOT_FOUND",
|
||||
// message: "Invitation not found",
|
||||
// });
|
||||
// }
|
||||
// return {
|
||||
// ...user,
|
||||
// isExpired: user.isRegistered,
|
||||
// };
|
||||
const user = await db.query.users_temp.findFirst({
|
||||
where: eq(users_temp.token, token),
|
||||
columns: {
|
||||
id: true,
|
||||
email: true,
|
||||
token: true,
|
||||
isRegistered: true,
|
||||
},
|
||||
});
|
||||
if (!user) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Invitation not found",
|
||||
});
|
||||
}
|
||||
return {
|
||||
...user,
|
||||
isExpired: user.isRegistered,
|
||||
};
|
||||
};
|
||||
|
||||
export const removeUserById = async (userId: string) => {
|
||||
|
||||
Reference in New Issue
Block a user