This commit is contained in:
Vins 2024-04-23 11:05:05 +02:00
parent 84d36140fd
commit 9701ea6301

View File

@ -102,11 +102,6 @@ export default class UserController extends ApiController {
} }
} }
if (!isSubscribed) {
this.httpUnauthorized(response, "User not subscribed");
return;
}
//Check if user is whitelisted //Check if user is whitelisted
// const isWhitelisted = await this.whitelistService.getByEmail(userHydrated.contact!.email); // const isWhitelisted = await this.whitelistService.getByEmail(userHydrated.contact!.email);
@ -130,7 +125,13 @@ export default class UserController extends ApiController {
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" }); const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
if(!manageSubscriptionRules[0]) return; if(!manageSubscriptionRules[0]) return;
payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || []; payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
isSubscribed = true;
}
if (!isSubscribed) {
this.httpUnauthorized(response, "User not subscribed");
return;
} }
const accessToken = this.authService.generateAccessToken(payload); const accessToken = this.authService.generateAccessToken(payload);