Skip to content

Instantly share code, notes, and snippets.

@bjoerntx

bjoerntx/test.cs Secret

Created July 25, 2023 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/886c6bffc9b80d09aa41c753a9e5c3a2 to your computer and use it in GitHub Desktop.
Save bjoerntx/886c6bffc9b80d09aa41c753a9e5c3a2 to your computer and use it in GitHub Desktop.
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