From 0d49c70207d1d63912f3aa92a97246c13b22db97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20Akg=C3=BCl?= <s86116@bht-berlin.de> Date: Tue, 11 Jul 2023 23:47:22 +0200 Subject: [PATCH] s --- components/nav-mobile.tsx | 1 - lib/auth.ts | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/components/nav-mobile.tsx b/components/nav-mobile.tsx index 7c9b7e1..8a3c1e8 100644 --- a/components/nav-mobile.tsx +++ b/components/nav-mobile.tsx @@ -1,7 +1,6 @@ "use client" import { Icons } from "@/components/icons" -import { cn } from "@/lib/utils" import { SidebarNavItem } from "@/types" import { User } from "next-auth" import Link from "next/link" diff --git a/lib/auth.ts b/lib/auth.ts index bb2d397..bfd6f0e 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -36,10 +36,12 @@ export const authOptions: NextAuthOptions = { const user = await db.user.findFirst({ where: { - OR: [ - { username: credentials.usernameOrEmail.toLowerCase() }, - { email: credentials.usernameOrEmail.toLowerCase() }, - ], + OR: [{ + username: credentials.usernameOrEmail.toLowerCase() + }, + { + email: credentials.usernameOrEmail.toLowerCase() + }], }, }) @@ -52,9 +54,9 @@ export const authOptions: NextAuthOptions = { user.password ) - if(!user.emailVerified){ + if (!user.emailVerified) { throw new Error('Email is not verified') - } + } if (!isPasswordValid) { throw new Error('invalid password') -- GitLab