mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
:refactor: Fix lint issues
This commit is contained in:
parent
5a546e426d
commit
4fba6a883a
|
@ -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',
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue