mirror of
https://github.com/harivansh-afk/Saas-Teamspace.git
synced 2026-04-15 12:03:53 +00:00
27 lines
571 B
TypeScript
27 lines
571 B
TypeScript
import { db } from '@/lib/db'
|
|
|
|
export const getVerificationTokenByToken = async (token: string) => {
|
|
// Get Verification Token
|
|
try {
|
|
const verificationToken = await db.verificationToken.findUnique({
|
|
where: { token }
|
|
})
|
|
|
|
return verificationToken
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
export const getVerificationTokenByEmail = async (email: string) => {
|
|
// Get Email Verification
|
|
try {
|
|
const verificationToken = await db.verificationToken.findFirst({
|
|
where: { email }
|
|
})
|
|
|
|
return verificationToken
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|