diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs index 85822414cf..dee3b3c492 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpController.cs @@ -108,12 +108,12 @@ namespace Volo.Abp.AspNetCore.Mvc return localizer; } - protected RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null) + protected virtual RedirectResult RedirectSafely(string returnUrl, string returnUrlHash = null) { return Redirect(GetRedirectUrl(returnUrl, returnUrlHash)); } - private string GetRedirectUrl(string returnUrl, string returnUrlHash = null) + protected virtual string GetRedirectUrl(string returnUrl, string returnUrlHash = null) { returnUrl = NormalizeReturnUrl(returnUrl); @@ -125,7 +125,7 @@ namespace Volo.Abp.AspNetCore.Mvc return returnUrl; } - private string NormalizeReturnUrl(string returnUrl) + protected virtual string NormalizeReturnUrl(string returnUrl) { if (returnUrl.IsNullOrEmpty()) { 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 0283a22046..944b9ef0ee 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 @@ -24,7 +24,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication return RedirectSafely(returnUrl, returnUrlHash); } - return Challenge(new AuthenticationProperties {RedirectUri = returnUrl}, ChallengeAuthenticationSchemas); + return Challenge(new AuthenticationProperties {RedirectUri = GetRedirectUrl(returnUrl, returnUrlHash)}, ChallengeAuthenticationSchemas); } [HttpGet] @@ -37,7 +37,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication return RedirectSafely(returnUrl, returnUrlHash); } - return SignOut(new AuthenticationProperties {RedirectUri = returnUrl}, ChallengeAuthenticationSchemas); + return SignOut(new AuthenticationProperties {RedirectUri = GetRedirectUrl(returnUrl, returnUrlHash)}, ChallengeAuthenticationSchemas); } [HttpGet]