Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ReturnUrl from the user's profile link #16071

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Piedone marked this conversation as resolved.
Show resolved Hide resolved
<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