From 149e870e09c3bc8a4a39fef00adc2e08d0067239 Mon Sep 17 00:00:00 2001 From: tkach_as <tkach_as@groupbwt.com> Date: Fri, 3 Feb 2023 17:28:43 +0200 Subject: [PATCH] feat: changed prisma --- src/components/Auth/Auth.tsx | 6 +++--- src/prisma/schema.prisma | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Auth/Auth.tsx b/src/components/Auth/Auth.tsx index 51458ea..a893224 100644 --- a/src/components/Auth/Auth.tsx +++ b/src/components/Auth/Auth.tsx @@ -24,17 +24,17 @@ const Auth: React.FC<AuthProps> = ({ session, reloadSession }) => { if (!username) return try { - debugger const { data } = await createUsername({ variables: { username, }, }) + if (!data?.createUsername) { throw new Error() } + if (data.createUsername.error) { - debugger const { createUsername: { error }, } = data @@ -83,7 +83,7 @@ const Auth: React.FC<AuthProps> = ({ session, reloadSession }) => { <Button onClick={(e) => { e.preventDefault() - signIn('google', { callbackUrl: process.env.NEXTAUTH_URL }) + signIn('google', { callbackUrl: 'http://localhost:3000' }) }} leftIcon={ <Image diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index b6c90d7..90b17e1 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -42,8 +42,8 @@ model User { username String? @unique accounts Account[] sessions Session[] - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + // createdAt DateTime @default(now()) + // updatedAt DateTime @updatedAt } model VerificationToken { -- GitLab