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 +1 -1
- package/src/server/index.js +4 -0
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -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
|
}
|