Skip to content

Commit

Permalink
Remove the ReturnUrl from the user's profile link (#16071)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored May 16, 2024
1 parent f424722 commit 07ddde9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,14 @@ public async Task<IActionResult> EditPost(string id, string returnUrl)

await _notifier.SuccessAsync(H["User updated successfully."]);

if (editingOwnUser)
if (!string.IsNullOrEmpty(returnUrl))
{
if (!string.IsNullOrEmpty(returnUrl))
{
return this.LocalRedirect(returnUrl, true);
}

return RedirectToAction(nameof(Edit));
return this.LocalRedirect(returnUrl, true);
}

if (!string.IsNullOrEmpty(returnUrl))
if (editingOwnUser)
{
return this.LocalRedirect(returnUrl, true);
return RedirectToAction(nameof(Edit));
}

return RedirectToAction(nameof(Index));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
@if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.EditOwnUser))
{
<li>
<a class="dropdown-item" asp-area="OrchardCore.Users" asp-action="Edit" asp-controller="Admin" asp-route-returnUrl="@FullRequestPath">
<a class="dropdown-item" asp-area="OrchardCore.Users" asp-action="Edit" asp-controller="Admin">
<i class="far fa-address-card" aria-hidden="true"></i> @T["Profile"]
</a>
</li>
}
else if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.ViewUsers))
{
<li>
<a class="dropdown-item" asp-area="OrchardCore.Users" asp-action="Display" asp-controller="Admin" asp-route-id="@User.FindFirstValue(ClaimTypes.NameIdentifier)" asp-route-returnUrl="@FullRequestPath">
<a class="dropdown-item" asp-area="OrchardCore.Users" asp-action="Display" asp-controller="Admin" asp-route-id="@User.FindFirstValue(ClaimTypes.NameIdentifier)">
<i class="far fa-address-card" aria-hidden="true"></i> @T["Profile"]
</a>
</li>
Expand Down

0 comments on commit 07ddde9

Please sign in to comment.