@duvdu-v1/duvdu 1.1.253 → 1.1.254
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.
|
@@ -72,6 +72,8 @@ const isauthenticated = (req, res, next) => __awaiter(void 0, void 0, void 0, fu
|
|
|
72
72
|
en: `Forbidden: User is blocked ${req.loggedUser.isBlocked.reason}`,
|
|
73
73
|
ar: ` ممنوع: المستخدم محظور ${req.loggedUser.isBlocked.reason}`,
|
|
74
74
|
}, req.lang));
|
|
75
|
+
if (user.isDeleted)
|
|
76
|
+
return next(new unauthorized_error_1.UnauthorizedError({ en: 'user not found', ar: 'لا يوجد مستخدم' }, req.lang));
|
|
75
77
|
const role = yield Role_model_1.Roles.findById(user.role);
|
|
76
78
|
if (!role)
|
|
77
79
|
return res.status(423).json({ message: 'invalid role' });
|
|
@@ -24,6 +24,8 @@ const optionalAuthenticated = (req, res, next) => __awaiter(void 0, void 0, void
|
|
|
24
24
|
en: `Forbidden: User is blocked ${req.loggedUser.isBlocked.reason}`,
|
|
25
25
|
ar: ` ممنوع: المستخدم محظور ${req.loggedUser.isBlocked.reason}`,
|
|
26
26
|
}, req.lang));
|
|
27
|
+
if (req.loggedUser.isDeleted)
|
|
28
|
+
return next(new unauthorized_error_1.UnauthorizedError({ en: 'user not found', ar: 'لا يوجد مستخدم' }, req.lang));
|
|
27
29
|
}
|
|
28
30
|
catch (error) {
|
|
29
31
|
return next();
|
|
@@ -18,6 +18,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
18
18
|
appleId: { type: String, default: null },
|
|
19
19
|
email: { type: String, unique: true, sparse: true },
|
|
20
20
|
name: { type: String, default: null },
|
|
21
|
+
isDeleted: { type: Boolean, default: false },
|
|
21
22
|
phoneNumber: {
|
|
22
23
|
key: { type: String, default: null },
|
|
23
24
|
number: { type: String, unique: true, sparse: true },
|
package/build/types/User.d.ts
CHANGED