@wrcb/cb-common 1.0.280 → 1.0.282
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.
|
@@ -11,13 +11,13 @@ const userRole_1 = require("../types/userRole");
|
|
|
11
11
|
const country_1 = require("../types/country");
|
|
12
12
|
function signUpReturnCookie(id, overrides) {
|
|
13
13
|
// Build a JWT payload
|
|
14
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.User, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false,
|
|
14
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.User, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
15
15
|
);
|
|
16
16
|
return buildCookie(payload);
|
|
17
17
|
}
|
|
18
18
|
function signUpReturnCookieAdmin(id, overrides) {
|
|
19
19
|
// Build a JWT payload
|
|
20
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false,
|
|
20
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappNumberVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
21
21
|
);
|
|
22
22
|
return buildCookie(payload);
|
|
23
23
|
}
|
|
@@ -4,7 +4,7 @@ exports.requireVerifiedPhoneNumber = void 0;
|
|
|
4
4
|
const badRequestError_1 = require("../errors/badRequestError");
|
|
5
5
|
const requireVerifiedPhoneNumber = (req, res, next) => {
|
|
6
6
|
var _a;
|
|
7
|
-
if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.
|
|
7
|
+
if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isWhatsappNumberVerified)) {
|
|
8
8
|
throw new badRequestError_1.BadRequestError('RequireVerifiedPhoneNumber');
|
|
9
9
|
}
|
|
10
10
|
next();
|
|
@@ -4,7 +4,7 @@ exports.requireVerifiedWhatsappNumber = void 0;
|
|
|
4
4
|
const badRequestError_1 = require("../errors/badRequestError");
|
|
5
5
|
const requireVerifiedWhatsappNumber = (req, res, next) => {
|
|
6
6
|
var _a;
|
|
7
|
-
if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.
|
|
7
|
+
if (!((_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.isWhatsappNumberVerified)) {
|
|
8
8
|
throw new badRequestError_1.BadRequestError('RequireVerifiedWhatsappNumber');
|
|
9
9
|
}
|
|
10
10
|
next();
|