javascript-ampache 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-ampache",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "A JS library for the Ampache API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.m.js",
package/src/base.ts CHANGED
@@ -65,7 +65,7 @@ export abstract class Base {
65
65
 
66
66
  if (this.debug) {
67
67
  console.debug(
68
- "javascript-ampache query URL %c" + url + authString,
68
+ "javascript-ampache query URL %c" + url,
69
69
  "color: black; font-style: italic; background-color: orange;padding: 2px",
70
70
  );
71
71
  }
@@ -96,7 +96,7 @@ export abstract class Base {
96
96
 
97
97
  if (this.debug) {
98
98
  console.debug(
99
- "javascript-ampache query URL %c" + url + this.useBearerToken ? "&auth=" + this.sessionKey : "",
99
+ "javascript-ampache query URL %c" + url,
100
100
  "color: black; font-style: italic; background-color: orange;padding: 2px",
101
101
  );
102
102
  }
@@ -123,6 +123,7 @@ export abstract class Base {
123
123
  * @param [params]
124
124
  */
125
125
  public rawURL(endpoint: string, params?: {}) {
126
+ let authString = "&auth=" + this.sessionKey;
126
127
  let query = endpoint;
127
128
  query += qs.stringify(params, "&");
128
129
 
@@ -131,9 +132,13 @@ export abstract class Base {
131
132
  "/server/json.server.php?action=" + query +
132
133
  "&version=" + this.version;
133
134
 
135
+ if (!this.useBearerToken) {
136
+ url += authString;
137
+ }
138
+
134
139
  if (this.debug) {
135
140
  console.debug(
136
- "javascript-ampache query URL %c" + url + this.useBearerToken ? "&auth=" + this.sessionKey : "",
141
+ "javascript-ampache query URL %c" + url,
137
142
  "color: black; font-style: italic; background-color: orange;padding: 2px",
138
143
  );
139
144
  }