diff --git a/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs b/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs index 73d7b8c83..f66ad52a0 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs +++ b/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs @@ -297,7 +297,10 @@ namespace IdentityServer4.Quickstart.UI.Controllers } if (returnUrl != null) { - return Redirect(returnUrl); + if (HttpContext.User.Identity.IsAuthenticated) + return Redirect(returnUrl); + else + return RedirectToAction("login", "account", new { returnUrl = returnUrl }); } return RedirectToAction("index", "home");