From 2a1e416a4ee0f21f3876ac2a3c9ed046f68c6ed3 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 14 Nov 2023 19:37:25 +0800 Subject: [PATCH] Redirect to home page when access denied. --- .../Mvc/Authentication/ChallengeAccountController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs index 8a5a8c2073..36b941cd4a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; @@ -61,12 +61,12 @@ public abstract class ChallengeAccountController : AbpController } [HttpGet] - public virtual Task AccessDenied(string returnUrl = "", string returnUrlHash = "") + public virtual Task AccessDenied() { return Task.FromResult(Challenge( new AuthenticationProperties { - RedirectUri = GetRedirectUrl(returnUrl, returnUrlHash) + RedirectUri = "/" }, (ForbidSchemes.IsNullOrEmpty() ? new[]