From 011ed225a2c65c0000bcd38672d788c84f6519c8 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 8 Apr 2025 14:43:13 +0200 Subject: [PATCH] feat: remove token req --- lib/salix.js | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/lib/salix.js b/lib/salix.js index e14b1e9..9f2e40f 100644 --- a/lib/salix.js +++ b/lib/salix.js @@ -18,35 +18,12 @@ module.exports = class Salix { this._logInfo = []; this._salixVersion = null; this._salixConfig = null; - this._token = null; } emit() {} subscribe(externalListenerFunction) { this.emit = externalListenerFunction; } - async getToken() { - const { url: path, user, password } = this.conf.salix.api.login; - let response; - try { - response = await fetch(`${this.conf.salix.url}/${path}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - Accept: "application/json", - }, - body: JSON.stringify({ - user, - password, - }), - }); - response = await response.json(); - } catch (error) { - console.error(error); - } - this.token = response.token; - } - async init(logger) { this.conf = logger.conf; const salixFileConfig = await this.loadConfig(); @@ -158,7 +135,6 @@ module.exports = class Salix { method: "GET", headers: { "Content-Type": "application/json", - Authorization: `${this.token}`, }, }; @@ -223,13 +199,6 @@ module.exports = class Salix { get logInfo() { return this._logInfo; } - - get token() { - return this._token; - } - set token(token) { - this._token = token; - } get salixVersion() { return this._salixVersion; }