Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 6eede2e

Browse files
committed
Bug fix at Url redirect after choose language
1 parent 48bbfd4 commit 6eede2e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Frontend/Jp.UI.SSO/Controllers/Home/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public IActionResult SetLanguage(string culture, string returnUrl = "")
6666
if (string.IsNullOrEmpty(returnUrl))
6767
return RedirectToAction("Index");
6868

69-
return LocalRedirect(returnUrl);
69+
return LocalRedirect(Request.Headers["Referer"].ToString());
7070
}
7171
}
7272
}

src/Frontend/Jp.UI.SSO/Views/Shared/_SelectLanguagePartial.cshtml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
@using System.Threading.Tasks
2-
@using Microsoft.AspNetCore.Builder
3-
@using Microsoft.AspNetCore.Localization
4-
@using Microsoft.AspNetCore.Mvc.Localization
5-
@using Microsoft.Extensions.Options
1+
@using Microsoft.AspNetCore.Mvc.Localization
62

73
@inject IViewLocalizer Localizer
84

@@ -14,10 +10,10 @@
1410
<div class="dropdown-header text-center">
1511
<strong>@Localizer["Title-Available-Languages"]</strong>
1612
</div>
17-
<a asp-controller="Home" asp-action="SetLanguage" asp-route-culture="pt-BR" asp-route-returnUrl="@Context.Request.Path" class="dropdown-item">
13+
<a asp-controller="Home" asp-action="SetLanguage" asp-route-culture="pt-BR" asp-route-returnUrl="@Context.Request.Path.ToString().Trim()" class="dropdown-item">
1814
<i class="flag-icon flag-icon-br"></i> @Localizer["Title-Português"]
1915
</a>
20-
<a asp-controller="Home" asp-action="SetLanguage" asp-route-culture="en" asp-route-returnUrl="@Context.Request.Path" class="dropdown-item">
16+
<a asp-controller="Home" asp-action="SetLanguage" asp-route-culture="en" asp-route-returnUrl="@Context.Request.Path.ToString().Trim()" class="dropdown-item">
2117
<i class="flag-icon flag-icon-us"></i> @Localizer["Title-English"]
2218
</a>
2319
</div>

0 commit comments

Comments
 (0)