From a6c8c8c825cfee0ef035b809747bd4279b53b33d Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sat, 7 Jan 2023 15:30:07 -0800 Subject: [PATCH] Fix signing into correct user with credentials --- .../edit-document-list/edit-document/document.module.css | 1 - .../post-files/view-document/document.module.css | 1 - src/lib/server/auth.ts | 7 +------ src/lib/server/prisma.ts | 1 - src/pages/api/user/tokens.ts | 2 -- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css b/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css index 209eee49..7ade9f44 100644 --- a/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css +++ b/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css @@ -11,7 +11,6 @@ .documentContainer { display: flex; flex-direction: column; - min-height: 400px; overflow: auto; } diff --git a/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css b/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css index 132b0e25..f2f82db1 100644 --- a/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css +++ b/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css @@ -13,7 +13,6 @@ .documentContainer { display: flex; flex-direction: column; - min-height: 400px; overflow: auto; padding: var(--gap); border: 1px solid var(--lighter-gray); diff --git a/src/lib/server/auth.ts b/src/lib/server/auth.ts index ad7a5ab6..2cbbaf27 100644 --- a/src/lib/server/auth.ts +++ b/src/lib/server/auth.ts @@ -119,7 +119,6 @@ const providers = () => { } }) - console.log("New user created") return newUser } } @@ -160,8 +159,7 @@ export const authOptions: NextAuthOptions = { id: user.id }, data: { - username: user.name, - displayName: user.name + username: user.name?.replace(/ /g, "-") } }) } @@ -187,9 +185,6 @@ export const authOptions: NextAuthOptions = { OR: [ { username: user?.username - }, - { - email: user?.email } ] } diff --git a/src/lib/server/prisma.ts b/src/lib/server/prisma.ts index 5dd7ec6b..2d30cec0 100644 --- a/src/lib/server/prisma.ts +++ b/src/lib/server/prisma.ts @@ -117,7 +117,6 @@ export async function getPostsByUser(userId: User["id"], withFiles?: boolean) { }) } }) - console.log(posts) return posts } diff --git a/src/pages/api/user/tokens.ts b/src/pages/api/user/tokens.ts index 4cf763fe..d4145268 100644 --- a/src/pages/api/user/tokens.ts +++ b/src/pages/api/user/tokens.ts @@ -27,8 +27,6 @@ export default async function handle( } }) - console.log(tokens) - return res.json(tokens) } case "POST": {