Skip to content

Commit

Permalink
Production deployment (#1097)
Browse files Browse the repository at this point in the history
**Only merge using a merge commit!**
  • Loading branch information
simonknittel authored Jan 21, 2025
2 parents e42a9b2 + 7a8bce2 commit 7bfb606
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- DropIndex
DROP INDEX "EmailConfirmationToken_userId_email_key";

-- AlterTable
ALTER TABLE "EmailConfirmationToken" ADD CONSTRAINT "EmailConfirmationToken_pkey" PRIMARY KEY ("token");

-- DropIndex
DROP INDEX "EmailConfirmationToken_token_key";
6 changes: 2 additions & 4 deletions app/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,11 @@ model VerificationToken {
}

model EmailConfirmationToken {
token String @id
email String
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
email String
token String @unique
expires DateTime
@@unique([userId, email])
}

//
Expand Down
2 changes: 1 addition & 1 deletion app/src/auth/utils/emailConfirmation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export const requestEmailConfirmation = async (

await prisma.emailConfirmationToken.create({
data: {
userId,
token: emailConfirmationToken,
email: userEmail,
userId,
expires: new Date(Date.now() + 1000 * 60 * 60 * 24), // 24 hours
},
});
Expand Down

0 comments on commit 7bfb606

Please sign in to comment.