fix: use lowercase email for user model findOne method

This commit is contained in:
Faruk AYDIN
2023-10-13 13:21:55 +02:00
parent 82ad0735d2
commit fe820fb4fe
3 changed files with 12 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ type Params = {
const forgotPassword = async (_parent: unknown, params: Params) => {
const { email } = params.input;
const user = await User.query().findOne({ email });
const user = await User.query().findOne({ email: email.toLowerCase() });
if (!user) {
throw new Error('Email address not found!');