Fix login
This commit is contained in:
commit
8045b818c7
@ -124,9 +124,7 @@ export default class OfficeRolesController extends ApiController {
|
||||
return;
|
||||
}
|
||||
|
||||
if (req.body.rules) {
|
||||
console.log(req.body.rules);
|
||||
|
||||
if (req.body.rules) {
|
||||
const allRules = await this.rulesService.get({
|
||||
where: {
|
||||
namespace: "global",
|
||||
|
@ -121,7 +121,8 @@ export default class UserController extends ApiController {
|
||||
|
||||
|
||||
if(!isSubscribed && userHydrated.role?.name === "admin" || userHydrated.role?.name === "super-admin"){
|
||||
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { name: "Gestion de l'abonnement" }, include: { rules: true } });
|
||||
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { uid: "94343601-04c8-44ef-afb9-3047597528a9" }, include: { rules: true } });
|
||||
console.log(manageSubscriptionRulesEntity);
|
||||
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
|
||||
if(!manageSubscriptionRules[0]) return;
|
||||
|
||||
|
@ -157,12 +157,6 @@ export class BackendVariables {
|
||||
@IsNotEmpty()
|
||||
public readonly STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID!: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
public readonly STRIPE_PAYMENT_SUCCESS_URL!: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
public readonly STRIPE_PAYMENT_CANCEL_URL!: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
public readonly IDNOT_PROD_BASE_URL!: string;
|
||||
|
||||
@ -219,8 +213,6 @@ export class BackendVariables {
|
||||
this.STRIPE_STANDARD_ANNUAL_SUBSCRIPTION_PRICE_ID = process.env["STRIPE_STANDARD_ANNUAL_SUBSCRIPTION_PRICE_ID"]!;
|
||||
this.STRIPE_UNLIMITED_SUBSCRIPTION_PRICE_ID = process.env["STRIPE_UNLIMITED_SUBSCRIPTION_PRICE_ID"]!;
|
||||
this.STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID = process.env["STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID"]!;
|
||||
this.STRIPE_PAYMENT_SUCCESS_URL = process.env["STRIPE_PAYMENT_SUCCESS_URL"]!;
|
||||
this.STRIPE_PAYMENT_CANCEL_URL = process.env["STRIPE_PAYMENT_CANCEL_URL"]!;
|
||||
this.IDNOT_PROD_BASE_URL = process.env["IDNOT_PROD_BASE_URL"]!;
|
||||
}
|
||||
public async validate(groups?: string[]) {
|
||||
|
@ -874,6 +874,7 @@ export default async function main() {
|
||||
},
|
||||
{
|
||||
name: "Gestion de l'abonnement",
|
||||
uid: "94343601-04c8-44ef-afb9-3047597528a9",
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
rules : [
|
||||
@ -1973,6 +1974,7 @@ export default async function main() {
|
||||
for (const ruleGroup of rulesGroups) {
|
||||
await prisma.rulesGroups.create({
|
||||
data: {
|
||||
uid: ruleGroup.uid,
|
||||
name: ruleGroup.name,
|
||||
rules: {
|
||||
connect: ruleGroup.rules?.map((rule) => ({
|
||||
|
@ -14,9 +14,7 @@ const storage = multer.memoryStorage();
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const variables = await Container.get(BackendVariables).validate();
|
||||
console.log(variables.DATABASE_NAME);
|
||||
|
||||
const variables = await Container.get(BackendVariables).validate();
|
||||
const port = variables.APP_PORT;
|
||||
const rootUrl = variables.APP_ROOT_URL;
|
||||
const label = variables.APP_LABEL ?? "Unknown Service";
|
||||
|
Loading…
x
Reference in New Issue
Block a user