@exulu/backend 1.69.1 → 1.69.2
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/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11187,10 +11187,11 @@ init_auth();
|
|
|
11187
11187
|
var requestValidators = {
|
|
11188
11188
|
authenticate: async (req) => {
|
|
11189
11189
|
const rawApiKey = req.headers["exulu-api-key"] || req.headers["x-api-key"];
|
|
11190
|
-
const
|
|
11190
|
+
const stripped = rawApiKey?.replace(/^Bearer\s+/i, "") ?? null;
|
|
11191
|
+
const apikey = stripped?.includes("/") ? stripped : void 0;
|
|
11191
11192
|
const { db: db2 } = await postgresClient();
|
|
11192
11193
|
let authtoken = null;
|
|
11193
|
-
if (
|
|
11194
|
+
if (!apikey) {
|
|
11194
11195
|
authtoken = await getToken((req.headers["authorization"] || req.headers["x-api-key"]) ?? "");
|
|
11195
11196
|
}
|
|
11196
11197
|
return await authentication({
|
package/dist/index.js
CHANGED
|
@@ -213,10 +213,11 @@ import "express";
|
|
|
213
213
|
var requestValidators = {
|
|
214
214
|
authenticate: async (req) => {
|
|
215
215
|
const rawApiKey = req.headers["exulu-api-key"] || req.headers["x-api-key"];
|
|
216
|
-
const
|
|
216
|
+
const stripped = rawApiKey?.replace(/^Bearer\s+/i, "") ?? null;
|
|
217
|
+
const apikey = stripped?.includes("/") ? stripped : void 0;
|
|
217
218
|
const { db } = await postgresClient();
|
|
218
219
|
let authtoken = null;
|
|
219
|
-
if (
|
|
220
|
+
if (!apikey) {
|
|
220
221
|
authtoken = await getToken((req.headers["authorization"] || req.headers["x-api-key"]) ?? "");
|
|
221
222
|
}
|
|
222
223
|
return await authentication({
|