Implemented email verification
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import NextAuth from 'next-auth'
|
||||
import { UserRole } from '@prisma/client'
|
||||
import { PrismaAdapter } from '@auth/prisma-adapter'
|
||||
import { db } from '@/lib/db'
|
||||
import db from '@/lib/db'
|
||||
import authConfig from '@/auth.config'
|
||||
import { getUserById } from '@/data/user'
|
||||
import { AUTH_ERROR_URL, AUTH_LOGIN_URL } from '@/config/routes'
|
||||
@@ -61,7 +61,7 @@ export const {
|
||||
if (!token.sub) return token
|
||||
|
||||
const existingUser = await getUserById(token.sub)
|
||||
|
||||
|
||||
if (!existingUser) return token
|
||||
|
||||
token.role = existingUser.role
|
||||
|
||||
Reference in New Issue
Block a user