Fixed login

This commit is contained in:
Vins 2024-04-24 09:50:26 +02:00
parent 577edf5566
commit f70085a7ac
5 changed files with 6 additions and 15 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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[]) {

View File

@ -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) => ({

View File

@ -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";