Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
VDS-106: Fix wrang redirection at NoTheme and "Allow anonymus" disabled"
Browse files Browse the repository at this point in the history
  • Loading branch information
trueboroda authored and pushnitsa committed Nov 26, 2020
1 parent 6e8cdcb commit bfbd2fb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
throw new ArgumentNullException(nameof(context));
}

var isItNoThemeAction = context.RouteData.Values.TryGetValue("controller", out var controller)
&& context.RouteData.Values.TryGetValue("action", out var action)
&& controller as string == "Common" && action as string == "NoTheme";

// Don not call filter for ReExecute requests (such as status code pages) and skips all paths marked as AllowAnonymous attribute
if (context.HttpContext.Features.Get<IStatusCodeReExecuteFeature>() != null || context.Filters.Any(x => x is IAllowAnonymousFilter))
if (context.HttpContext.Features.Get<IStatusCodeReExecuteFeature>() != null || context.Filters.Any(x => x is IAllowAnonymousFilter) || isItNoThemeAction)
{
return;
}
Expand Down

0 comments on commit bfbd2fb

Please sign in to comment.