mirror of
https://github.com/harivansh-afk/Saas-Teamspace.git
synced 2026-04-15 09:01:17 +00:00
25 lines
588 B
TypeScript
25 lines
588 B
TypeScript
import { db } from '@/lib/db'
|
|
|
|
// token functionality
|
|
export const getPasswordResetTokenByToken = async (token: string) => {
|
|
try {
|
|
const passwordResetToken = await db.passwordResetToken.findUnique({
|
|
where: { token }
|
|
})
|
|
return passwordResetToken
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
// Token Email functionality (match emails)
|
|
export const getPasswordResetTokenByEmail = async (email: string) => {
|
|
try {
|
|
const passwordResetToken = await db.passwordResetToken.findFirst({
|
|
where: { email }
|
|
})
|
|
return passwordResetToken
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|