diff --git a/account/src/lib/user-utils.ts b/account/src/lib/user-utils.ts index 2421437..6ef9dd7 100644 --- a/account/src/lib/user-utils.ts +++ b/account/src/lib/user-utils.ts @@ -157,14 +157,12 @@ export async function createNewUser( lastLogin: now, lastActive: now, }; - console.log("SENDING VERIFICATION EMAIL FROM SIGNUP"); await sendVerificationEmail({ name: input.name, uid: userId, email: input.email || "", token: email.token, }); - console.log("GOT THROUGH AFTER VERIFICATION"); const user = await insertLingdocsUser(newUser); return user; } diff --git a/account/src/routers/auth-router.ts b/account/src/routers/auth-router.ts index 086fc32..c04820c 100644 --- a/account/src/routers/auth-router.ts +++ b/account/src/routers/auth-router.ts @@ -176,7 +176,8 @@ const authRouter = (passport: PassportStatic) => { try { const { email, password, name } = req.body; const existingUser = await getLingdocsUser("email", email); - if (existingUser) return res.send("User Already Exists"); + if (existingUser) + return res.send({ ok: false, message: "User Already Exists" }); try { const user = await createNewUser({ strategy: "local", @@ -190,8 +191,7 @@ const authRouter = (passport: PassportStatic) => { }); } catch (e) { console.error(e); - console.error("EMAIL DIDN'T WORK 2"); - return res.send("Invalid E-mail"); + return res.send({ ok: false, message: "Invalid E-mail" }); } } catch (e) { next(e);