prevent logged in user from logging in

This commit is contained in:
Michael 2017-04-21 19:56:40 -04:00
parent 1cc5a79c8c
commit bc56237435

View file

@ -84,6 +84,8 @@ await UserManager.SendEmailAsync(uid, "Confirm your account", $@"### Please conf
[AllowAnonymous]
public ActionResult Login(string returnUrl)
{
if (Request.IsAuthenticated)
return Redirect(returnUrl);
ViewBag.ReturnUrl = returnUrl;
return View();
}
@ -174,6 +176,8 @@ public async Task<ActionResult> VerifyCode(VerifyCodeViewModel model)
[AllowAnonymous]
public ActionResult Register()
{
if (Request.IsAuthenticated)
return RedirectToAction("Index", "Ho,e");
return View();
}