diff --git a/apps/merchant-app/app/api/user/route.ts b/apps/merchant-app/app/api/user/route.ts index fd5df926..4e7553b3 100644 --- a/apps/merchant-app/app/api/user/route.ts +++ b/apps/merchant-app/app/api/user/route.ts @@ -1,13 +1,13 @@ import { NextResponse } from "next/server" -import { PrismaClient } from "@repo/db/client"; - -const client = new PrismaClient(); +import prisma from "@repo/db/client"; export const GET = async () => { - await client.user.create({ + await prisma.user.create({ data: { email: "asd", - name: "adsads" + name: "adsads", + password:"lol", + number:"123" } }) return NextResponse.json({ diff --git a/apps/merchant-app/lib/auth.ts b/apps/merchant-app/lib/auth.ts index 8d38ac07..54456480 100644 --- a/apps/merchant-app/lib/auth.ts +++ b/apps/merchant-app/lib/auth.ts @@ -1,5 +1,6 @@ import GoogleProvider from "next-auth/providers/google"; import db from "@repo/db/client"; +import { Account, Profile, User } from "next-auth"; export const authOptions = { providers: [ @@ -9,15 +10,22 @@ export const authOptions = { }) ], callbacks: { - async signIn({ user, account }: { - user: { - email: string; - name: string - }, - account: { - provider: "google" | "github" - } - }) { + + +async signIn({ + user, + account, + profile, + email, + credentials, +}: { + user: User; + account: Account | null; + profile?: Profile; + email?: { verificationRequest?: boolean }; + credentials?: Record; +}) + { console.log("hi signin") if (!user || !user.email) { return false; @@ -33,11 +41,11 @@ export const authOptions = { create: { email: user.email, name: user.name, - auth_type: account.provider === "google" ? "Google" : "Github" // Use a prisma type here + auth_type: account?.provider === "google" ? "Google" : "Github" // Use a prisma type here }, update: { name: user.name, - auth_type: account.provider === "google" ? "Google" : "Github" // Use a prisma type here + auth_type: account?.provider === "google" ? "Google" : "Github" // Use a prisma type here } }); diff --git a/packages/store/package.json b/packages/store/package.json index b92ae809..c652f651 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -6,6 +6,6 @@ "recoil": "^0.7.7" }, "exports": { - "./balance": "./src/hooks/useBalance" + "./balance": "./src/hooks/useBalance.ts" } }