From 05f76535972f8b3ab36eea49aa70765fb43cf41b Mon Sep 17 00:00:00 2001 From: omkieit Date: Sat, 7 Sep 2024 19:38:04 +0530 Subject: [PATCH] done --- ef-api/controllers/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ef-api/controllers/user.js b/ef-api/controllers/user.js index 11404ba..c14b37f 100644 --- a/ef-api/controllers/user.js +++ b/ef-api/controllers/user.js @@ -2,6 +2,7 @@ import dotenv from "dotenv"; import UserModal from "../models/user.js"; import bcrypt from "bcryptjs"; import jwt from "jsonwebtoken"; +import { sendEmail } from "../utils/sendEmail.js"; dotenv.config(); const secret = process.env.SECRET_KEY; @@ -37,12 +38,11 @@ export const signup = async (req, res) => { // Save the token in the user's tokens array result.tokens.push({ token }); - // Save the user await result.save(); - // console.log("ss", result) const url = `Click on the link ${process.env.RETURN_URL}/users/${result._id}/verify/${token}`; await sendEmail(result.email, "Verify Email", url); + console.log("url", url); // Send the user info and token back to the client res.status(201).json({ result, token });