Skip to content
Snippets Groups Projects
Commit 0d49c702 authored by Yusuf Akgül's avatar Yusuf Akgül :hatching_chick:
Browse files

s

parent 635e960b
No related branches found
No related tags found
1 merge request!51Mobile
"use client" "use client"
import { Icons } from "@/components/icons" import { Icons } from "@/components/icons"
import { cn } from "@/lib/utils"
import { SidebarNavItem } from "@/types" import { SidebarNavItem } from "@/types"
import { User } from "next-auth" import { User } from "next-auth"
import Link from "next/link" import Link from "next/link"
......
...@@ -36,10 +36,12 @@ export const authOptions: NextAuthOptions = { ...@@ -36,10 +36,12 @@ export const authOptions: NextAuthOptions = {
const user = await db.user.findFirst({ const user = await db.user.findFirst({
where: { where: {
OR: [ OR: [{
{ username: credentials.usernameOrEmail.toLowerCase() }, username: credentials.usernameOrEmail.toLowerCase()
{ email: credentials.usernameOrEmail.toLowerCase() }, },
], {
email: credentials.usernameOrEmail.toLowerCase()
}],
}, },
}) })
...@@ -52,9 +54,9 @@ export const authOptions: NextAuthOptions = { ...@@ -52,9 +54,9 @@ export const authOptions: NextAuthOptions = {
user.password user.password
) )
if(!user.emailVerified){ if (!user.emailVerified) {
throw new Error('Email is not verified') throw new Error('Email is not verified')
} }
if (!isPasswordValid) { if (!isPasswordValid) {
throw new Error('invalid password') throw new Error('invalid password')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment