This commit is contained in:
Benjamin Toby 2025-04-16 12:53:11 +01:00
parent fe97939faf
commit cd224b24df
5 changed files with 9 additions and 5 deletions

View File

@ -65,7 +65,8 @@ function loginUser(_a) {
* @description Check required fields
*/
const isEmailValid = yield (0, validate_email_1.default)({ email: payload.email });
if (!payload.email || !isEmailValid.isValid) {
if ((!payload.email && !payload.username) ||
(payload.email && !isEmailValid.isValid)) {
return {
success: false,
payload: null,

View File

@ -1045,7 +1045,7 @@ export type MariadbRemoteServerUserObject = {
};
export type APILoginFunctionParams = {
encryptionKey: string;
email: string;
email?: string;
username?: string;
password?: string;
database: string;

View File

@ -114,7 +114,10 @@ export default async function loginUser({
*/
const isEmailValid = await validateEmail({ email: payload.email });
if (!payload.email || !isEmailValid.isValid) {
if (
(!payload.email && !payload.username) ||
(payload.email && !isEmailValid.isValid)
) {
return {
success: false,
payload: null,

View File

@ -1211,7 +1211,7 @@ export type MariadbRemoteServerUserObject = {
export type APILoginFunctionParams = {
encryptionKey: string;
email: string;
email?: string;
username?: string;
password?: string;
database: string;

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/datasquirel",
"version": "4.2.7",
"version": "4.2.8",
"description": "Cloud-based SQL data management tool",
"main": "dist/index.js",
"bin": {