public override void OnAuthorization(HttpActionContext actionContext) { AuthentificationService authentificationService = new AuthentificationService(actionContext); if (!authentificationService.IsAuthorized()) { base.OnAuthorization(actionContext); } else { return; } }
public void OnAuthorization(AuthorizationContext filterContext) { AuthentificationService authentificationService = new AuthentificationService(filterContext); if (!authentificationService.IsAuthorized()) { var urlHelper = new UrlHelper(filterContext.RequestContext); filterContext.Result = new RedirectResult(urlHelper.Action("Logon", "Home")); } else { return; } }