rads-db 3.0.22 → 3.0.23

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.
@@ -11,6 +11,7 @@ var _lodash = _interopRequireDefault(require("lodash"));
11
11
  var _restEndpointsDev = _interopRequireDefault(require("./restEndpointsDev.cjs"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
  function getRadsUiUser(radsAuthHeader, apiKey) {
14
+ if (!radsAuthHeader) return void 0;
14
15
  apiKey = apiKey || process.env.RadsApiKey;
15
16
  if (!apiKey) {
16
17
  throw (0, _h.createError)({
@@ -18,7 +19,6 @@ function getRadsUiUser(radsAuthHeader, apiKey) {
18
19
  message: `Please, provide "apiKey" option to "getRadsUiUser" call.`
19
20
  });
20
21
  }
21
- if (!radsAuthHeader) return void 0;
22
22
  const [keyType, key, email, pretendAsUserId] = radsAuthHeader.split(" ");
23
23
  if (!email || !keyType || !key || keyType !== "ApiKey") {
24
24
  throw (0, _h.createError)({
@@ -2,12 +2,12 @@ import { createError } from "h3";
2
2
  import _ from "lodash";
3
3
  import restEndpointsDev from "./restEndpointsDev.mjs";
4
4
  export function getRadsUiUser(radsAuthHeader, apiKey) {
5
+ if (!radsAuthHeader)
6
+ return void 0;
5
7
  apiKey = apiKey || process.env.RadsApiKey;
6
8
  if (!apiKey) {
7
9
  throw createError({ statusCode: 401, message: `Please, provide "apiKey" option to "getRadsUiUser" call.` });
8
10
  }
9
- if (!radsAuthHeader)
10
- return void 0;
11
11
  const [keyType, key, email, pretendAsUserId] = radsAuthHeader.split(" ");
12
12
  if (!email || !keyType || !key || keyType !== "ApiKey") {
13
13
  throw createError({ statusCode: 401, message: `Unauthorized - malformed authHeader` });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rads-db",
3
- "version": "3.0.22",
3
+ "version": "3.0.23",
4
4
  "files": [
5
5
  "dist",
6
6
  "drivers",