From 373946b5c6d81694180a2c66145727aca3b3e6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ca=C3=B1izares=20Est=C3=A9vez?= Date: Wed, 14 Dec 2016 14:31:55 +0100 Subject: [PATCH] Solve problem in register process (when not auth user click login in web mvc and the users register before authentication takes place) --- .../Controllers/AccountController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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");