From b10cc6adb4e87911bf34cda85a84974953bd0257 Mon Sep 17 00:00:00 2001 From: Boris Date: Mon, 24 May 2021 12:02:43 +0100 Subject: [PATCH] Fix broken redirect on Register() Application should redirect to home page if [url] parameter is empty. --- .../ContosoWebApplication/Controllers/AccountController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delegation/ContosoWebApplication/ContosoWebApplication/Controllers/AccountController.cs b/delegation/ContosoWebApplication/ContosoWebApplication/Controllers/AccountController.cs index e8ebcc7..cc5e61d 100644 --- a/delegation/ContosoWebApplication/ContosoWebApplication/Controllers/AccountController.cs +++ b/delegation/ContosoWebApplication/ContosoWebApplication/Controllers/AccountController.cs @@ -168,7 +168,7 @@ public async Task Register(RegisterViewModel model) await SignInAsync(user, isPersistent: false); - if (string.IsNullOrEmpty(model.ReturnUrl)) + if (!string.IsNullOrEmpty(model.ReturnUrl)) return Redirect(model.ReturnUrl); else return RedirectToAction("Index", "Home");