mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Moving redirect suppression logic
This commit is contained in:
@@ -16,6 +16,8 @@ namespace Orchard.Users.Services {
|
||||
|
||||
public void OnAuthenticationChallenge(AuthenticationChallengeContext filterContext) {
|
||||
if (filterContext.Result is HttpUnauthorizedResult) {
|
||||
filterContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true;
|
||||
|
||||
filterContext.Result = new RedirectToRouteResult(
|
||||
new RouteValueDictionary
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace Orchard.UI.Admin {
|
||||
if (IsAdmin(filterContext)) {
|
||||
if (!_authorizer.Authorize(StandardPermissions.AccessAdminPanel, T("Can't access the admin"))) {
|
||||
filterContext.Result = new HttpUnauthorizedResult();
|
||||
filterContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true;
|
||||
}
|
||||
|
||||
Apply(filterContext.RequestContext);
|
||||
|
||||
Reference in New Issue
Block a user