From 17498654f404a0d6bc9deb7b5566680cf04deb8c Mon Sep 17 00:00:00 2001 From: Divyanshgupta030 <145568562+Divyanshgupta030@users.noreply.github.com> Date: Sun, 17 Nov 2024 20:21:25 +0530 Subject: [PATCH] fix social sign-in --- apps/api/app/api/[[...route]]/route.ts | 1 - apps/app/middleware.ts | 2 +- packages/auth/package.json | 2 +- .../20241117140010_social/migration.sql | 18 ++++++++++++++++++ packages/database/prisma/schema.prisma | 1 + pnpm-lock.yaml | 10 +++++----- 6 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 packages/database/prisma/migrations/20241117140010_social/migration.sql diff --git a/apps/api/app/api/[[...route]]/route.ts b/apps/api/app/api/[[...route]]/route.ts index df54523..d296646 100644 --- a/apps/api/app/api/[[...route]]/route.ts +++ b/apps/api/app/api/[[...route]]/route.ts @@ -54,7 +54,6 @@ app.get("/health", async (c) => { }); }); - app.route("/session", session); app.route("/hello", hello); app.route("/mail", mail); diff --git a/apps/app/middleware.ts b/apps/app/middleware.ts index be4464a..18724eb 100644 --- a/apps/app/middleware.ts +++ b/apps/app/middleware.ts @@ -7,7 +7,7 @@ const baseDomain = : "http://localhost:3001"; const redirectUrl = process.env.NODE_ENV === "production" - ? "https://ww.plura.pro/auth" + ? "https://www.plura.pro/auth" : "http://localhost:3003/auth"; export default async function authMiddleware(request: NextRequest) { const { data: session } = await betterFetch( diff --git a/packages/auth/package.json b/packages/auth/package.json index 38aa855..7f56722 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -12,7 +12,7 @@ "dependencies": { "@repo/typescript-config": "workspace:*", "@repo/db": "workspace:*", - "better-auth": "0.8.6-beta.3", + "better-auth": "0.8.6-beta.4", "better-call": "0.2.14-beta.3", "oslo": "^1.2.1" } diff --git a/packages/database/prisma/migrations/20241117140010_social/migration.sql b/packages/database/prisma/migrations/20241117140010_social/migration.sql new file mode 100644 index 0000000..5228644 --- /dev/null +++ b/packages/database/prisma/migrations/20241117140010_social/migration.sql @@ -0,0 +1,18 @@ +/* + Warnings: + + - Added the required column `createdAt` to the `verification` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "verification" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL; + +-- CreateTable +CREATE TABLE "Trigger" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "email" TEXT NOT NULL, + "emailVerified" BOOLEAN NOT NULL, + + CONSTRAINT "Trigger_pkey" PRIMARY KEY ("id") +); diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index b0ff338..5fb6c0c 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -55,6 +55,7 @@ model Verification { identifier String value String expiresAt DateTime + createdAt DateTime @@map("verification") } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5512a0e..b6f3314 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -507,8 +507,8 @@ importers: specifier: workspace:* version: link:../typescript-config better-auth: - specifier: 0.8.6-beta.3 - version: 0.8.6-beta.3 + specifier: 0.8.6-beta.4 + version: 0.8.6-beta.4 better-call: specifier: 0.2.14-beta.3 version: 0.2.14-beta.3 @@ -3550,8 +3550,8 @@ packages: better-auth@0.8.1-beta.1: resolution: {integrity: sha512-IFBOPOoRooZoJ883UTA5AjpEiTcFCQNecKj5LJytYTv1E+g/F1AibwGMp7jLq2DJJSfuBdtcCn32Fc0qHroSZQ==} - better-auth@0.8.6-beta.3: - resolution: {integrity: sha512-9V8JB0Sg+Xv/st/zRqyZfXRnc05Ic+7K1v5inlg3KKNuajBUVWsBjAKzBlqhU57qP1EYOIBxMjZ/6JriWvqawQ==} + better-auth@0.8.6-beta.4: + resolution: {integrity: sha512-Gw9BokQg1O0m5WxZocblb5kUAN1SPa/vyCKoJ5+3b7KNA2CH3Lr0ERsXQPlaZg8QLihJMxDcKpGWXXVxXTeQXw==} better-call@0.2.14-beta.3: resolution: {integrity: sha512-lA54ETanzM0xUZnQt6lm3BdTr4gVDyAe1DNpCQSTYUnwnGGOmQG8ob0FYivVd0XHsHQK68r01GB5c6cUuu4llQ==} @@ -10398,7 +10398,7 @@ snapshots: transitivePeerDependencies: - encoding - better-auth@0.8.6-beta.3: + better-auth@0.8.6-beta.4: dependencies: '@better-fetch/fetch': 1.1.12 '@noble/ciphers': 0.6.0