mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
:refactor: Fix lint issues
This commit is contained in:
@@ -43,7 +43,7 @@ export function authenticationMethods(this: N8nApp): void {
|
||||
throw new Error('Unable to access database.');
|
||||
}
|
||||
|
||||
if (!user || !user.password || !(await compareHash(req.body.password, user.password))) {
|
||||
if (!user?.password || !(await compareHash(req.body.password, user.password))) {
|
||||
// password is empty until user signs up
|
||||
const error = new Error('Wrong username or password. Do you have caps lock on?');
|
||||
// @ts-ignore
|
||||
|
||||
@@ -55,7 +55,7 @@ export function passwordResetNamespace(this: N8nApp): void {
|
||||
// User should just be able to reset password if one is already present
|
||||
const user = await Db.collections.User.findOne({ email, password: Not(IsNull()) });
|
||||
|
||||
if (!user || !user.password) {
|
||||
if (!user?.password) {
|
||||
Logger.debug(
|
||||
'Request to send password reset email failed because no user was found for the provided email',
|
||||
{ invalidEmail: email },
|
||||
|
||||
@@ -279,7 +279,7 @@ export function usersNamespace(this: N8nApp): void {
|
||||
|
||||
const inviter = users.find((user) => user.id === inviterId);
|
||||
|
||||
if (!inviter || !inviter.email || !inviter.firstName) {
|
||||
if (!inviter?.email || !inviter?.firstName) {
|
||||
Logger.error(
|
||||
'Request to resolve signup token failed because inviter does not exist or is not set up',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user