:refactor: Fix lint issues

This commit is contained in:
Jan Oberhauser
2022-08-24 16:50:36 +02:00
parent 5a546e426d
commit 4fba6a883a
3 changed files with 3 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ export function authenticationMethods(this: N8nApp): void {
throw new Error('Unable to access database.'); 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 // password is empty until user signs up
const error = new Error('Wrong username or password. Do you have caps lock on?'); const error = new Error('Wrong username or password. Do you have caps lock on?');
// @ts-ignore // @ts-ignore

View File

@@ -55,7 +55,7 @@ export function passwordResetNamespace(this: N8nApp): void {
// User should just be able to reset password if one is already present // User should just be able to reset password if one is already present
const user = await Db.collections.User.findOne({ email, password: Not(IsNull()) }); const user = await Db.collections.User.findOne({ email, password: Not(IsNull()) });
if (!user || !user.password) { if (!user?.password) {
Logger.debug( Logger.debug(
'Request to send password reset email failed because no user was found for the provided email', 'Request to send password reset email failed because no user was found for the provided email',
{ invalidEmail: email }, { invalidEmail: email },

View File

@@ -279,7 +279,7 @@ export function usersNamespace(this: N8nApp): void {
const inviter = users.find((user) => user.id === inviterId); const inviter = users.find((user) => user.id === inviterId);
if (!inviter || !inviter.email || !inviter.firstName) { if (!inviter?.email || !inviter?.firstName) {
Logger.error( Logger.error(
'Request to resolve signup token failed because inviter does not exist or is not set up', 'Request to resolve signup token failed because inviter does not exist or is not set up',
{ {