From bc5623743500eb9a37bdcad7a324c6ad8f517685 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Apr 2017 19:56:40 -0400 Subject: prevent logged in user from logging in --- Project-Unite/Controllers/AccountController.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Project-Unite/Controllers/AccountController.cs') diff --git a/Project-Unite/Controllers/AccountController.cs b/Project-Unite/Controllers/AccountController.cs index 6309184..2eb5806 100644 --- a/Project-Unite/Controllers/AccountController.cs +++ b/Project-Unite/Controllers/AccountController.cs @@ -84,6 +84,8 @@ The address used to send this message is not a no-reply address. In fact, my nam [AllowAnonymous] public ActionResult Login(string returnUrl) { + if (Request.IsAuthenticated) + return Redirect(returnUrl); ViewBag.ReturnUrl = returnUrl; return View(); } @@ -174,6 +176,8 @@ The address used to send this message is not a no-reply address. In fact, my nam [AllowAnonymous] public ActionResult Register() { + if (Request.IsAuthenticated) + return RedirectToAction("Index", "Ho,e"); return View(); } -- cgit v1.2.3