Implemented email verification
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { db } from '@/lib/db'
|
||||
import db from '@/lib/db'
|
||||
import { VerificationToken } from '@prisma/client'
|
||||
|
||||
export const getVerificationTokenByToken = async (token: string) => {
|
||||
try {
|
||||
@@ -8,7 +9,7 @@ export const getVerificationTokenByToken = async (token: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getVerificationTokenByEmail = async (email: string) => {
|
||||
export const getVerificationTokenByEmail = async (email: string): Promise<VerificationToken | null> => {
|
||||
try {
|
||||
return await db.verificationToken.findFirst({ where: { email } })
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user