authRouter.post("/login", async (req, res) => {
  try {
    const user = await User.findOne({
      username: req.body.username,
    });
    if (!user) {
      return res
        .status(401)
        .json({ message: "Incorrect username or password" });
    }

    let hashedPassword = CryptoJS.AES.decrypt(
      user.password,
      process.env.PASSWORD_SECRET || ""
    );
    let userPassword = hashedPassword.toString(CryptoJS.enc.Utf8);

    if (userPassword !== req.body.password) {
      return res
        .status(401)
        .json({ message: "Incorrect username or password" });
    }

    const { password, ...others } = user._doc;
    res.status(200).json(others);
  } catch (err) {
    console.error(err);
    res.status(500).json({
      message: "There was a problem logging in. Please try again later.",
    });
  }
});
export default authRouter;
error TS2339: Property '_doc' does not exist on type 'Document<unknown, {}, { createdAt: NativeDate; updatedAt: NativeDate; } & { username: string; email: 
string; password: string; isAdmin: boolean; }> & Omit<{ ...; } & ... 1 more ... & { ...; 
}, never>'.

47     const { password, ...others } = user._doc;
