From 2132240549cca44813ce54778cc27d0849288da5 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Wed, 23 Oct 2024 17:19:44 +0200 Subject: [PATCH] chore: remove eslintConfig from package.json --- lib/socket.js | 6 +++--- package.json | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/socket.js b/lib/socket.js index 4989356..783bf51 100755 --- a/lib/socket.js +++ b/lib/socket.js @@ -237,7 +237,7 @@ internals.Socket.prototype._onMessage = async function (message) { try { var request = JSON.parse(message); } - catch (err) { + catch { return this._error(Boom.badRequest('Cannot parse message')); } @@ -563,7 +563,7 @@ internals.Socket.prototype._authenticate = async function (request) { const auth = await Iron.unseal(request.auth, config.password, config.iron ?? Iron.defaults); this._setCredentials(auth); } - catch (err) { + catch { throw Boom.unauthorized('Invalid token'); } } @@ -585,7 +585,7 @@ internals.Socket.prototype._authByCookie = async function () { try { var { states } = await this.server.states.parse(cookies); } - catch (err) { + catch { throw Boom.unauthorized('Invalid nes authentication cookie'); } diff --git a/package.json b/package.json index 55a9e2c..30ee07e 100755 --- a/package.json +++ b/package.json @@ -16,11 +16,6 @@ "plugin", "websocket" ], - "eslintConfig": { - "extends": [ - "plugin:@hapi/module" - ] - }, "dependencies": { "@hapi/boom": "^10.0.1", "@hapi/bounce": "^3.0.1", @@ -34,9 +29,9 @@ }, "devDependencies": { "@hapi/code": "^9.0.3", - "@hapi/eslint-plugin": "*", + "@hapi/eslint-plugin": "^7.0.0", "@hapi/hapi": "^21.3.9", - "@hapi/lab": "^25.2.0", + "@hapi/lab": "^26.0.0", "@types/node": "^20.14.2", "joi": "^17.13.3", "typescript": "^5.4.5"