-
-
Save bjoerntx/886c6bffc9b80d09aa41c753a9e5c3a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomActionFilter : ActionFilterAttribute { | |
public override void OnActionExecuting(ActionExecutingContext filterContext) { | |
if (filterContext.HttpContext.Request.Query["secureID"] != "123") { | |
filterContext.Result = new Microsoft.AspNetCore.Mvc.ContentResult() { | |
Content = "Access denied" | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment