propro-utils 1.5.19 → 1.5.20

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.19",
3
+ "version": "1.5.20",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -153,6 +153,10 @@ class AuthMiddleware {
153
153
 
154
154
  const user = await checkIfUserExists(this.userSchema, account.accountId);
155
155
 
156
+ if (!user) {
157
+ throw new Error('User not found');
158
+ }
159
+
156
160
  if (returnTokens === 'true') {
157
161
  return res.status(200).json({ account, user, tokens });
158
162
  }