diff --git a/sites/backend/src/models/apikey.mjs b/sites/backend/src/models/apikey.mjs index f4f96c2a761..11ee22979fc 100644 --- a/sites/backend/src/models/apikey.mjs +++ b/sites/backend/src/models/apikey.mjs @@ -1,6 +1,6 @@ import { log } from '../utils/log.mjs' -import { hash, hashPassword, randomString, verifyPassword } from '../utils/crypto.mjs' -import { clean, asJson } from '../utils/index.mjs' +import { hashPassword, randomString, verifyPassword } from '../utils/crypto.mjs' +import { asJson } from '../utils/index.mjs' import { UserModel } from './user.mjs' export function ApikeyModel(tools) { diff --git a/sites/backend/src/models/pattern.mjs b/sites/backend/src/models/pattern.mjs index d02b7c82a96..70d4da58ed8 100644 --- a/sites/backend/src/models/pattern.mjs +++ b/sites/backend/src/models/pattern.mjs @@ -247,7 +247,7 @@ PatternModel.prototype.unguardedDelete = async function () { /* * Removes the pattern - Checks permissions */ -PatternModel.prototype.guardedDelete = async function ({ params, body, user }) { +PatternModel.prototype.guardedDelete = async function ({ params, user }) { if (user.level < 3) return this.setResponse(403, 'insufficientAccessLevel') if (user.iss && user.status < 1) return this.setResponse(403, 'accountStatusLacking') diff --git a/sites/backend/src/models/user.mjs b/sites/backend/src/models/user.mjs index 95a50a44e91..7c257f9fba7 100644 --- a/sites/backend/src/models/user.mjs +++ b/sites/backend/src/models/user.mjs @@ -39,7 +39,7 @@ UserModel.prototype.read = async function (where) { /* * Helper method to decrypt at-rest data */ -UserModel.prototype.reveal = async function (where) { +UserModel.prototype.reveal = async function () { this.clear = {} if (this.record) { for (const field of this.encryptedFields) { @@ -274,12 +274,12 @@ UserModel.prototype.confirm = async function ({ body, params }) { await this.Confirmation.read({ id: params.id }) if (!this.Confirmation.exists) { - log.warn(err, `Could not find confirmation id ${params.id}`) + log.warn(`Could not find confirmation id ${params.id}`) return this.setResponse(404) } if (this.Confirmation.record.type !== 'signup') { - log.warn(err, `Confirmation mismatch; ${params.id} is not a signup id`) + log.warn(`Confirmation mismatch; ${params.id} is not a signup id`) return this.setResponse(404) } @@ -356,7 +356,6 @@ UserModel.prototype.guardedUpdate = async function ({ body, user }) { data.lusername = clean(body.username) } else { log.info(`Rejected user name change from ${data.username} to ${body.username.trim()}`) - notes.push('usernameChangeRejected') } } // Image (img) @@ -401,12 +400,12 @@ UserModel.prototype.guardedUpdate = async function ({ body, user }) { await this.Confirmation.read({ id: body.confirmation }) if (!this.Confirmation.exists) { - log.warn(err, `Could not find confirmation id ${params.id}`) + log.warn(`Could not find confirmation id ${body.confirmation}`) return this.setResponse(404) } if (this.Confirmation.record.type !== 'emailchange') { - log.warn(err, `Confirmation mismatch; ${params.id} is not an emailchange id`) + log.warn(`Confirmation mismatch; ${body.confirmation} is not an emailchange id`) return this.setResponse(404) } @@ -630,7 +629,7 @@ UserModel.prototype.isLusernameAvailable = async function (lusername) { try { await this.prisma.user.findUnique({ where: { lusername } }) } catch (err) { - log.warn({ err, where }, 'Could not search for free username') + log.warn({ err, lusername }, 'Could not search for free username') } return true diff --git a/sites/backend/tests/shared.mjs b/sites/backend/tests/shared.mjs index 9239834fc48..210ab3d5554 100644 --- a/sites/backend/tests/shared.mjs +++ b/sites/backend/tests/shared.mjs @@ -122,6 +122,6 @@ export const setup = async () => { return { chai, config, expect, store } } -export const teardown = async function (store) { +export const teardown = async function (/*store*/) { //console.log(store) }