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"
import { Icons } from "@/components/icons"
import { cn } from "@/lib/utils"
import { SidebarNavItem } from "@/types"
import { User } from "next-auth"
import Link from "next/link"
......
......@@ -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')
......
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