@wrcb/cb-common 1.0.401 → 1.0.403
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { UserPayload } from '../types/userPayload';
|
|
2
2
|
export declare function signUpReturnCookie(id?: string, overrides?: Partial<UserPayload>): string[];
|
|
3
3
|
export declare function signUpReturnCookieAdmin(id?: string, overrides?: Partial<UserPayload>): string[];
|
|
4
|
+
export declare function signUpReturnCookieSeller(id?: string, overrides?: Partial<UserPayload>): string[];
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.signUpReturnCookie = signUpReturnCookie;
|
|
7
7
|
exports.signUpReturnCookieAdmin = signUpReturnCookieAdmin;
|
|
8
|
+
exports.signUpReturnCookieSeller = signUpReturnCookieSeller;
|
|
8
9
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
10
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
10
11
|
const userRole_1 = require("../types/userRole");
|
|
@@ -22,6 +23,12 @@ function signUpReturnCookieAdmin(id, overrides) {
|
|
|
22
23
|
);
|
|
23
24
|
return buildCookie(payload);
|
|
24
25
|
}
|
|
26
|
+
function signUpReturnCookieSeller(id, overrides) {
|
|
27
|
+
// Build a JWT payload
|
|
28
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Seller, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
29
|
+
);
|
|
30
|
+
return buildCookie(payload);
|
|
31
|
+
}
|
|
25
32
|
function buildCookie(payload) {
|
|
26
33
|
// Create the JWT
|
|
27
34
|
const token = jsonwebtoken_1.default.sign(payload, process.env.JWT_KEY);
|