propro-utils 1.3.33 → 1.3.34

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.
@@ -61,7 +61,11 @@ const getAccountProfile = async (redisClient, userSchema, accountId) => {
61
61
  const checkIfUserExists = async (userSchema, accountId) => {
62
62
  const user = await userSchema.findOne({ accountId });
63
63
  if (!user) {
64
- await userSchema.create({accountId});
64
+ await userSchema.create({
65
+ accountId,
66
+ id: uuidv4(),
67
+ verified: false,
68
+ });
65
69
  }
66
70
  };
67
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.3.33",
3
+ "version": "1.3.34",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -21,7 +21,7 @@ let _serverAuth, _clientAuth;
21
21
  * validateUser: async (userId) => { }, // Function to validate user
22
22
  * onAuthFailRedirect: '/login', // URL to redirect on authentication failure
23
23
  * additionalChecks: async (req) => { }, // Additional custom checks for requests
24
- * }
24
+ * },
25
25
  * @param {boolean} [options.useClientAuth=false] - A boolean flag to enable client-side authentication.
26
26
  * @param {Object} [options.clientOptions={}] - Configuration options for client-side authentication.
27
27
  * @param {Schema} [userSchema] - The user schema to perform the operations on.
@@ -39,7 +39,7 @@ let _serverAuth, _clientAuth;
39
39
  * additionalChecks: async (req) => { },
40
40
  * },
41
41
  * useClientAuth: false,
42
- * }));
42
+ * }, UserSchema));
43
43
  */
44
44
  module.exports = function proproAuthMiddleware(options = {}, userSchema) {
45
45
  validateEnvironmentVariables([