Skip to content

Commit

Permalink
Merge branch 'bugfix/DNN-44083' of https://github.com/kmuralidaran/Dn…
Browse files Browse the repository at this point in the history
…n.Platform into bugfix/DNN-44083
  • Loading branch information
kmuralidaran committed Oct 13, 2020
2 parents b78f1b8 + f3b4713 commit 02fb399
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ protected string RedirectURL
get
{
var redirectURL = string.Empty;

var setting = GetSetting(this.PortalId, "Redirect_AfterLogin");
var redirectAfterLoginUrl = Convert.ToInt32(GetSetting(this.PortalId, "Redirect_AfterLogin"));
var isValidRedirectAfterLoginUrl = this.NeedRedirectAfterLogin
&& redirectAfterLoginUrl != Null.NullInteger;

// first we need to check if there is a returnurl
if (this.Request.QueryString["returnurl"] != null)
Expand Down Expand Up @@ -111,6 +112,12 @@ protected string RedirectURL
redirectURL = UrlUtils.ValidReturnUrl(redirectURL);
}

// Reset redirect url for redirecting to 'Redirect After Login' page
if (isValidRedirectAfterLoginUrl)
{
redirectURL = string.Empty;
}

var alias = this.PortalAlias.HTTPAlias;
var comparison = StringComparison.InvariantCultureIgnoreCase;

Expand All @@ -120,12 +127,9 @@ protected string RedirectURL

if (string.IsNullOrEmpty(redirectURL) || isDefaultPage)
{
if (
this.NeedRedirectAfterLogin
&& (isDefaultPage || this.IsRedirectingFromLoginUrl())
&& Convert.ToInt32(setting) != Null.NullInteger)
if (isValidRedirectAfterLoginUrl && (isDefaultPage || this.IsRedirectingFromLoginUrl()))
{
redirectURL = this._navigationManager.NavigateURL(Convert.ToInt32(setting));
redirectURL = this._navigationManager.NavigateURL(redirectAfterLoginUrl);
}
else
{
Expand Down

0 comments on commit 02fb399

Please sign in to comment.