Skip to content

Commit

Permalink
added dotenv and added more error messages to login
Browse files Browse the repository at this point in the history
  • Loading branch information
aju-alen committed Dec 11, 2024
1 parent 419744e commit f12f650
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/controllers/auth-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import nodemailer from "nodemailer";
import crypto from "crypto";
import { backendUrl } from '../utils/backendUrl.js';
import { frontendURL } from '../utils/corsFe.js';
import dotenv from 'dotenv';

// Load environment variables from the .env file
dotenv.config();

const prisma = new PrismaClient();

Expand Down Expand Up @@ -294,7 +298,7 @@ export const userRegister = async (req, res, next) => {
return res.status(400).json({ message: "Invalid password. Try again." });
}
if (passwordMatch && user && !user.emailVerified) {
return res.status(401).json({ message: "You have not verified your email. Please check for your verification email on your registered inbox." })
return res.status(401).json({ message: "You have not verified your email. Please check for your verification email on your registered inbox. If you feel there is somethig wrong, contact us." })
}


Expand Down

0 comments on commit f12f650

Please sign in to comment.