mirror of
https://github.com/harivansh-afk/Saas-Teamspace.git
synced 2026-04-17 05:00:20 +00:00
initial commit
This commit is contained in:
commit
ef9ccf22d3
133 changed files with 20802 additions and 0 deletions
25
data/password-reset-token.ts
Normal file
25
data/password-reset-token.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue