@loomcore/api 0.2.25 → 0.2.26

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.
@@ -2,7 +2,6 @@ import jwt from "jsonwebtoken";
2
2
  import { BadRequestError, UnauthenticatedError, UnauthorizedError, } from "../errors/index.js";
3
3
  import { getAuthUserContextSpec } from "../utils/auth/auth-user-specs.util.js";
4
4
  import { getAuthConfig } from "../utils/auth/get-auth-config.util.js";
5
- import { isAdmin } from "../utils/auth/is-admin.util.js";
6
5
  function resolveAuthMethod(req) {
7
6
  switch (req.method.toUpperCase()) {
8
7
  case "GET":
@@ -47,10 +46,6 @@ const isAuthorized = (config) => {
47
46
  const rawPayload = jwt.verify(token, authConfig.clientSecret);
48
47
  const userContext = getAuthUserContextSpec().decode(rawPayload);
49
48
  req.userContext = userContext;
50
- if (isAdmin(userContext)) {
51
- next();
52
- return;
53
- }
54
49
  const method = resolveAuthMethod(req);
55
50
  if (!method) {
56
51
  throw new BadRequestError("Invalid HTTP method");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
6
  "scripts": {