File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
EZNEW.Web3.0/Security/Authorization Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ private static bool HasAllowAnonymous(AuthorizationFilterContext context)
43
43
44
44
public override async Task OnAuthorizationAsync ( AuthorizationFilterContext context )
45
45
{
46
- var originalResult = context . Result ;
47
- await base . OnAuthorizationAsync ( context ) . ConfigureAwait ( false ) ;
48
- if ( context . Result != null && ( ( context . Result is ChallengeResult && ! AuthorizationManager . IngoreAuthentication ) || context . Result is ForbidResult ) )
46
+ if ( ! AuthorizationManager . IngoreDefaultAuthorize )
49
47
{
50
- return ;
48
+ var originalResult = context . Result ;
49
+ await base . OnAuthorizationAsync ( context ) . ConfigureAwait ( false ) ;
50
+ if ( context . Result != null && ( ( context . Result is ChallengeResult && ! AuthorizationManager . IngoreAuthentication ) || context . Result is ForbidResult ) )
51
+ {
52
+ return ;
53
+ }
54
+ context . Result = originalResult ;
51
55
}
52
- context . Result = originalResult ;
53
56
if ( HasAllowAnonymous ( context ) ) //allow anonymous access
54
57
{
55
58
return ;
You can’t perform that action at this time.
0 commit comments