Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit bae99d7

Browse files
committed
feat: Link the auth_email module to the auth_providers module
1 parent 8227c7e commit bae99d7

File tree

22 files changed

+334
-409
lines changed

22 files changed

+334
-409
lines changed

modules/auth/db/migrations/20240310214734_init/migration.sql

Lines changed: 0 additions & 48 deletions
This file was deleted.

modules/auth/db/migrations/20240312024843_init/migration.sql

Lines changed: 0 additions & 12 deletions
This file was deleted.

modules/auth/db/migrations/20240312033322_/migration.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

modules/auth/db/migrations/20240312035811_/migration.sql

Lines changed: 0 additions & 21 deletions
This file was deleted.

modules/auth/module.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

modules/auth/tests/e2e.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
export interface Config {
2-
email?: EmailConfig;
3-
}
4-
5-
export interface EmailConfig {
62
fromEmail: string;
73
fromName?: string;
84
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- CreateTable
2+
CREATE TABLE "Verifications" (
3+
"id" UUID NOT NULL,
4+
"email" TEXT NOT NULL,
5+
"code" TEXT NOT NULL,
6+
"attemptCount" INTEGER NOT NULL DEFAULT 0,
7+
"maxAttemptCount" INTEGER NOT NULL,
8+
"createdAt" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
9+
"expireAt" TIMESTAMP NOT NULL,
10+
"completedAt" TIMESTAMP,
11+
12+
CONSTRAINT "Verifications_pkey" PRIMARY KEY ("id")
13+
);
14+
15+
-- CreateIndex
16+
CREATE UNIQUE INDEX "Verifications_code_key" ON "Verifications"("code");

modules/auth/db/schema.prisma renamed to modules/auth_email/db/schema.prisma

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,9 @@ datasource db {
33
url = env("DATABASE_URL")
44
}
55

6-
model EmailPasswordless {
7-
id String @id @default(uuid()) @db.Uuid
8-
userId String @db.Uuid @unique
9-
email String @unique
10-
createdAt DateTime @default(now()) @db.Timestamp
11-
}
12-
13-
model EmailPasswordlessVerification {
6+
model Verifications {
147
id String @id @default(uuid()) @db.Uuid
158
16-
// If exists, link to existing identity. If null, create new identity.
17-
userId String? @db.Uuid
18-
199
email String
2010
2111
// Code the user has to input to verify the email

0 commit comments

Comments
 (0)