feat(dokploy): add verification email to cloud version

This commit is contained in:
Mauricio Siu
2024-10-26 18:09:55 -06:00
parent 0873618c63
commit 680c22a41e
16 changed files with 4419 additions and 330 deletions

View File

@@ -50,6 +50,8 @@ export const auth = pgTable("auth", {
.$defaultFn(() => new Date().toISOString()),
resetPasswordToken: text("resetPasswordToken"),
resetPasswordExpiresAt: text("resetPasswordExpiresAt"),
confirmationToken: text("confirmationToken"),
confirmationExpiresAt: text("confirmationExpiresAt"),
});
export const authRelations = relations(auth, ({ many }) => ({

View File

@@ -20,7 +20,7 @@ export const createInvitation = async (
const result = await tx
.insert(auth)
.values({
email: input.email,
email: input.email.toLowerCase(),
rol: "user",
password: bcrypt.hashSync("01231203012312", 10),
})

View File

@@ -24,7 +24,7 @@ export const createAdmin = async (input: typeof apiCreateAdmin._type) => {
const newAuth = await tx
.insert(auth)
.values({
email: input.email,
email: input.email.toLowerCase(),
password: hashedPassword,
rol: "admin",
})
@@ -93,7 +93,7 @@ export const findAuthByEmail = async (email: string) => {
if (!result) {
throw new TRPCError({
code: "NOT_FOUND",
message: "Auth not found",
message: "User not found",
});
}
return result;