@aeriajs/builtins 0.0.286 → 0.0.288

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.
@@ -136,7 +136,7 @@ export const authenticate = async (props, context) => {
136
136
  }
137
137
  }
138
138
  const user = await context.collection.model.findOne({
139
- email: props.email,
139
+ email: props.email.toLowerCase(),
140
140
  }, {
141
141
  projection: {
142
142
  password: 1,
@@ -37,6 +37,7 @@ export const createAccount = async (payload, context) => {
37
37
  });
38
38
  }
39
39
  const user = payload;
40
+ user.email = user.email.toLowerCase();
40
41
  const { roles, ...defaults } = context.config.security.signup;
41
42
  if (user.password) {
42
43
  user.password = await bcrypt.hash(user.password, 10);
@@ -26,6 +26,9 @@ export const insert = async (payload, context) => {
26
26
  if (!context.token.authenticated) {
27
27
  throw new Error;
28
28
  }
29
+ if ('email' in payload.what && typeof payload.what.email === 'string') {
30
+ payload.what.email = payload.what.email.toLowerCase();
31
+ }
29
32
  if ('roles' in payload.what) {
30
33
  if (context.config.security.rolesHierarchy) {
31
34
  if (!arraysIntersect(context.token.roles, Object.keys(context.config.security.rolesHierarchy))) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
3
  "type": "module",
4
- "version": "0.0.286",
4
+ "version": "0.0.288",
5
5
  "description": "## Installation",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -38,14 +38,14 @@
38
38
  "@aeriajs/entrypoint": "link:../entrypoint",
39
39
  "@aeriajs/types": "link:../types",
40
40
  "@aeriajs/validation": "link:../validation",
41
- "mongodb": "^6.18.0"
41
+ "mongodb": "^6.19.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@aeriajs/common": "^0.0.161",
45
- "@aeriajs/core": "^0.0.286",
46
- "@aeriajs/entrypoint": "^0.0.169",
44
+ "@aeriajs/common": "^0.0.162",
45
+ "@aeriajs/core": "^0.0.288",
46
+ "@aeriajs/entrypoint": "^0.0.170",
47
47
  "@aeriajs/types": "^0.0.137",
48
- "@aeriajs/validation": "^0.0.185"
48
+ "@aeriajs/validation": "^0.0.186"
49
49
  },
50
50
  "scripts": {
51
51
  "test": "echo skipping",