Skip to content

Commit

Permalink
fix verify find
Browse files Browse the repository at this point in the history
  • Loading branch information
javtran committed Aug 19, 2024
1 parent e32f299 commit 259332f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/routes/api/v1/users/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export default async function (fastify, _opts) {
async (request, reply) => {
const { emailVerificationToken } = request.body;

let data = await fastify.prisma.user.findMany({
where: { emailVerificationToken: emailVerificationToken },
let data = await fastify.prisma.user.findUnique({
where: { emailVerificationToken },
});
if (data.length == 0) {
if (!data) {
return reply.notFound();
}
const user = new User(data[0]);
const user = new User(data);

if (!user.isEmailVerified) {
data = await fastify.prisma.user.update({
Expand Down

0 comments on commit 259332f

Please sign in to comment.