Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Web/Resgrid.Web/Areas/User/Views/Shared/_UserLayout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@
</script>

<script src="/js/int-bundle.js"></script>
<script>
// Guard Pace.js finish() against null element references (known issue with Zone.js interaction)
if (window.Pace && Pace.bar) {
var _origFinish = Pace.bar.finish.bind(Pace.bar);
Pace.bar.finish = function () {
try { return _origFinish(); } catch (e) {
document.body.className = document.body.className.replace('pace-running', '') + ' pace-done';
}
};
}
</script>
<script src="~/lib/chart.js/dist/chart.umd.min.js" asp-append-version="true"></script>
<script src="~/js/app/resgrid.js" asp-append-version="true"></script>
<script src="~/js/app/internal/resgrid.user.js" asp-append-version="true"></script>
Expand Down
4 changes: 3 additions & 1 deletion Web/Resgrid.Web/Filters/RequireActivePlanFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class RequireActivePlanFilter : IAsyncActionFilter
"paymentpending",
"paymentfailed",
"logstriperesponse",
"stripebillinginfoupdatesuccess"
"stripebillinginfoupdatesuccess",
"getpaddlecheckout",
"paddleprocessing"
Comment on lines +35 to +37
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Scope exemption by controller+action to avoid unintended plan-bypass expansion.

Adding these action-name exemptions globally means any User-area action named GetPaddleCheckout or PaddleProcessing in other controllers will bypass plan enforcement. Please constrain exemptions to explicit controller/action pairs (or endpoint metadata) so this remains narrowly targeted.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Web/Resgrid.Web/Filters/RequireActivePlanFilter.cs` around lines 35 - 37, The
current global action-name exemptions (e.g., "GetPaddleCheckout",
"PaddleProcessing", "stripebillinginfoupdatesuccess") in RequireActivePlanFilter
allow any controller with those action names to bypass plan checks; change the
exemption mechanism to check both controller and action names (controller+action
pair) instead of action-only. Update RequireActivePlanFilter (the filter method
that reads ActionDescriptor/RouteValues and the exemption list) to store allowed
exemptions as explicit (controller, action) pairs and perform matching using
context.ActionDescriptor.RouteValues["controller"] and ["action"] (or the
filterContext equivalents) so only the intended controller/action combinations
are exempted. Ensure existing single-action checks are replaced/augmented
accordingly and update any unit tests referencing the old action-only
exemptions.

};

public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
Expand Down
Loading