Browse Source

Merge pull request #17598 from abpframework/liangshiwei/patch

Get safe redirect url
pull/17599/head
maliming 3 years ago
committed by GitHub
parent
commit
44f35fa958
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs

16
modules/account/src/Volo.Abp.Account.Web/Pages/Account/LoggedOut.cshtml.cs

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NUglify.Helpers;
namespace Volo.Abp.Account.Web.Pages.Account;
@ -19,11 +20,26 @@ public class LoggedOutModel : AccountPageModel
public virtual Task<IActionResult> OnGetAsync()
{
NormalizeUrl();
return Task.FromResult<IActionResult>(Page());
}
public virtual Task<IActionResult> OnPostAsync()
{
NormalizeUrl();
return Task.FromResult<IActionResult>(Page());
}
protected virtual void NormalizeUrl()
{
if (!PostLogoutRedirectUri.IsNullOrWhiteSpace())
{
PostLogoutRedirectUri = Url.Content(GetRedirectUrl(PostLogoutRedirectUri));
}
if(!SignOutIframeUrl.IsNullOrWhiteSpace())
{
SignOutIframeUrl = Url.Content(GetRedirectUrl(SignOutIframeUrl));
}
}
}

Loading…
Cancel
Save