Updates
This commit is contained in:
parent
fe97939faf
commit
cd224b24df
@ -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,
|
||||
|
2
dist/package-shared/types/index.d.ts
vendored
2
dist/package-shared/types/index.d.ts
vendored
@ -1045,7 +1045,7 @@ export type MariadbRemoteServerUserObject = {
|
||||
};
|
||||
export type APILoginFunctionParams = {
|
||||
encryptionKey: string;
|
||||
email: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
database: string;
|
||||
|
@ -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,
|
||||
|
@ -1211,7 +1211,7 @@ export type MariadbRemoteServerUserObject = {
|
||||
|
||||
export type APILoginFunctionParams = {
|
||||
encryptionKey: string;
|
||||
email: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
database: string;
|
||||
|
@ -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": {
|
||||
|
Loading…
Reference in New Issue
Block a user