finished reset password & other changes
This commit is contained in:
17
data/password-reset-token.ts
Normal file
17
data/password-reset-token.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import db from '@/lib/db'
|
||||
|
||||
export const getPasswordResetTokenByToken = async (token: string) => {
|
||||
try {
|
||||
return await db.passwordResetToken.findUnique({ where: { token } })
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export const getPasswordResetTokenByEmail = async (email: string) => {
|
||||
try {
|
||||
return await db.passwordResetToken.findFirst({ where: { email } })
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import db from '@/lib/db'
|
||||
import { VerificationToken } from '@prisma/client'
|
||||
|
||||
export const getVerificationTokenByToken = async (token: string) => {
|
||||
try {
|
||||
@@ -9,7 +8,7 @@ export const getVerificationTokenByToken = async (token: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getVerificationTokenByEmail = async (email: string): Promise<VerificationToken | null> => {
|
||||
export const getVerificationTokenByEmail = async (email: string) => {
|
||||
try {
|
||||
return await db.verificationToken.findFirst({ where: { email } })
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user