@devmoods/express-extras 0.15.0 → 0.15.1

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/dist/auth.js +3 -2
  2. package/package.json +1 -1
package/dist/auth.js CHANGED
@@ -39,7 +39,7 @@ export function createAuth({ getUserByToken, methods: { emailAndPassword }, filt
39
39
  return [201, { token }];
40
40
  }
41
41
  catch (error) {
42
- getLogger('core').error(error);
42
+ logger.error(error);
43
43
  throw Unauthorized(error.message);
44
44
  }
45
45
  }));
@@ -82,6 +82,7 @@ export function createAuth({ getUserByToken, methods: { emailAndPassword }, filt
82
82
  throw BadRequest('invalid email');
83
83
  }
84
84
  await onPasswordChanged?.(user, await hashPassword(password));
85
+ await redis.del(token);
85
86
  logger.info('user changed password', { email: tokenEmail });
86
87
  return 200;
87
88
  }));
@@ -156,7 +157,7 @@ export function createAuth({ getUserByToken, methods: { emailAndPassword }, filt
156
157
  next();
157
158
  }
158
159
  catch (error) {
159
- getLogger('core').error(error);
160
+ logger.error(error);
160
161
  next(Unauthorized('Invalid token'));
161
162
  return;
162
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devmoods/express-extras",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Kubernetes-ready utilities for rapid Node.js application development",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",