Skip to content

Commit

Permalink
Adding returnurl to logoff (#13010)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidStania authored Dec 29, 2022
1 parent eefbfdb commit 0514eed
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ public async Task<IActionResult> Login(LoginViewModel model, string returnUrl =

[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> LogOff()
public async Task<IActionResult> LogOff(string returnUrl = null)
{
await _signInManager.SignOutAsync();
_logger.LogInformation(4, "User logged out.");

return Redirect("~/");
return RedirectToLocal(returnUrl);
}

[HttpGet]
Expand Down Expand Up @@ -300,7 +300,7 @@ private IActionResult RedirectToLocal(string returnUrl)
{
if (Url.IsLocalUrl(returnUrl))
{
return Redirect(returnUrl);
return Redirect(returnUrl.ToUriComponents());
}
else
{
Expand All @@ -322,7 +322,7 @@ await workflowManager.TriggerEventAsync(nameof(Workflows.Activities.UserLoggedIn
input: input, correlationId: ((User)user).UserId);
}

return RedirectToLocal(returnUrl.ToUriComponents());
return RedirectToLocal(returnUrl);
}

[HttpPost]
Expand Down

0 comments on commit 0514eed

Please sign in to comment.