Why the user is getting “undefined” as value

Here I am trying to verify the user using jwt token and then deletion of his account will be take place.

File: user.route.js

import express from "express";
import { verifyToken } from "../utils/verifyUser.js";
import { deleteUser } from "../controllers/user.controller.js";
const router = express.Router();

router.delete("/delete/:userId", verifyToken, deleteUser);

export default router;

File: verifyUser.js

import jwt from "jsonwebtoken";
import { errorHandler } from "./error.js";

 export const verifyToken = (req, res, next) => {
 console.log("Verifying process is called..");

 const token = req.cookies.access_token;

 console.log(`Token data: ${token}`);

 // console.log(`Your Token :${token}`);

  if (!token) {
   console.log("No Token found");
   return next(errorHandler(401, "Unauthorized"));
  }

  jwt.verify(token, process.env.JWT_SECRET, (err, user) => {
   if (err) {
   console.log("Token verification error");
   return next(errorHandler(401, "Unauthorized"));
  }
   console.log(`User data: ${JSON.stringify(user)}`);
   //user is added to the request
   req.user = user;
   // to invoke the second function in the put()
   next();
  });
};

File: user.controller.js

import { errorHandler } from "../utils/error.js";
import User from "../models/user.model.js";
//Delete Account Function
export const deleteUser = async function (req, res, next) {
//checking the user id
if (req.user.id !== req.params.userId) {
  console.log(`User ID: ${req.user.id}`);
  console.log(`Params: ${req.params.userId}`);
  return next(errorHandler(403, "You're not allowed to delete this user"));
}
try {
  await User.findByIdAndDelete(req.params.userId);
  res.status(200).json("User account is deleted");
} catch (error) {
  next(error);
}

};

But While checking the user in the verifyUser.js is assigned with undefined value.

As the result, req.user gets undefined as value.

So, that the deletion is not working as expected.

Can anyone help me with a solution for this?