@steedos/service-api 2.1.49 → 2.1.53

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.
Files changed (2) hide show
  1. package/index.js +1 -5
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -201,8 +201,6 @@ module.exports = {
201
201
  * Check the token value & resolve the user by the token.
202
202
  * The resolved user will be available in `ctx.meta.user`
203
203
  *
204
- * PLEASE NOTE, IT'S JUST AN EXAMPLE IMPLEMENTATION. DO NOT USE IN PRODUCTION!
205
- *
206
204
  * @param {Context} ctx
207
205
  * @param {Object} route
208
206
  * @param {IncomingRequest} req
@@ -220,8 +218,6 @@ module.exports = {
220
218
  /**
221
219
  * Authorize the request. Check that the authenticated user has right to access the resource.
222
220
  *
223
- * PLEASE NOTE, IT'S JUST AN EXAMPLE IMPLEMENTATION. DO NOT USE IN PRODUCTION!
224
- *
225
221
  * @param {Context} ctx
226
222
  * @param {Object} route
227
223
  * @param {IncomingRequest} req
@@ -232,7 +228,7 @@ module.exports = {
232
228
  const user = ctx.meta.user;
233
229
 
234
230
  if (!user) {
235
- throw new ApiGateway.Errors.UnAuthorizedError("NO_RIGHTS");
231
+ return res.status(401).send('NO_RIGHTS');
236
232
  }
237
233
 
238
234
  // // It check the `auth` property in action schema.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@steedos/service-api",
3
- "version": "2.1.49",
3
+ "version": "2.1.53",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "@steedos/auth": "2.1.49",
7
+ "@steedos/auth": "2.1.53",
8
8
  "graphql-type-json": "^0.3.2",
9
9
  "moleculer-apollo-server": "^0.3.3",
10
10
  "moleculer-web": "^0.9.1"
@@ -13,5 +13,5 @@
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
16
- "gitHead": "ad2d122d80c82c1419640d7cfde580024ff6b444"
16
+ "gitHead": "5001ce7ac23abc5d0722c3ba97b0c3c8a963d368"
17
17
  }