Skip to content

Commit 3aecde0

Browse files
committedMar 22, 2025
chore: resolve conflicts
2 parents bf58c92 + db935a1 commit 3aecde0

27 files changed

+543
-260
lines changed
 

‎LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 - 2024 Donald Pakkies
3+
Copyright (c) 2021 - 2025 Donald Pakkies
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Formidablejs Core
22

33
## About Formidablejs
4-
Note: This repository contains the core code of the Formidable framework. If you want to build an application using Formidable, visit the main [Formidablejs repository](https://github.com/formidablejs/formidablejs).
4+
Note: This repository contains the core code of the Formidable framework. If you want to build an application using Formidable, visit the main [Formidablejs repository](https://github.com/formidablejs/formidablejs-typescript).
55

66
<center>
77

‎package-lock.json

+42-69
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@formidablejs/framework",
3-
"version": "0.27.6",
3+
"version": "0.27.7",
44
"description": "Formidable Framework Core",
55
"author": "Donald Pakkies",
66
"license": "MIT",
@@ -58,16 +58,19 @@
5858
"redis": "^4.6.12",
5959
"session-file-store": "^1.5.0",
6060
"stacktrace-js": "^2.0.2",
61+
"ts-node": "^10.9.2",
6162
"validatorjs": "^3.22.1"
6263
},
6364
"peerDependencies": {
65+
"@faker-js/faker": ">= 8.3.0",
6466
"@formidablejs/mailer": ">=0.4.0",
65-
"@formidablejs/stubs": ">= 0.3.0",
67+
"@formidablejs/stubs": ">= 0.6.0",
6668
"imba-shell": ">=0.4.0 <0.5.0"
6769
},
6870
"devDependencies": {
71+
"@faker-js/faker": "^9.6.0",
6972
"@formidablejs/mailer": "0.4.0",
70-
"@formidablejs/stubs": "^0.5.1",
73+
"@formidablejs/stubs": "^0.6.0",
7174
"@types/connect-redis": "^0.0.18",
7275
"@types/express-session": "^1.17.5",
7376
"@types/jest": "^29.5.1",

‎src/Auth/Auth.imba

+7-4
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ class Auth
5353
let property = 'username'
5454

5555
if dbIdentifier === 'email'
56-
user = await Database.table(dbTable).where('email', body.email).first!
56+
user = await Database.table(dbTable).whereRaw('LOWER(email) = LOWER(?)', [body.email]).first!
5757

5858
property = 'email'
5959

6060
elif dbIdentifier === 'username'
61-
user = await Database.table(dbTable).where('username', body.username).first!
61+
user = await Database.table(dbTable).whereRaw('LOWER(username) = LOWER(?)', [body.username]).first!
6262
elif dbIdentifier === 'username-email'
63-
user = await Database.table(dbTable).where('username', body.username).orWhere('email', body.username).first!
63+
user = await Database.table(dbTable)
64+
.whereRaw('LOWER(username) = LOWER(?)', [body.username])
65+
.orWhereRaw('LOWER(email) = LOWER(?)', [body.username])
66+
.first!
6467

6568
if user && await Hash.check(body.password, user.password)
6669
return user
6770

6871
throw ValidationException.withMessages({
6972
[property]: [
70-
'Invalid credentials'
73+
"Invalid {dbIdentifier === 'email' ? 'Email' : 'Username'} or password."
7174
]
7275
})
7376

0 commit comments

Comments
 (0)
Failed to load comments.