0

Actually i'm working on a web-app in Asp.NET 5 and I'm looking for a solution that only Anonymous can have access to the LOGIN and REGISTER page.

If you have ideas ..

Clowning
  • 131
  • 1
  • 14
  • You can create a custom authorize attribute: http://stackoverflow.com/questions/31464359/custom-authorizeattribute-in-asp-net-5-mvc-6 – Sirwan Afifi Dec 31 '15 at 18:56

1 Answers1

1

Use this Code To Know the user is authenticated or not:

if (User.Identity.IsAuthenticated)
{
      Response.Redirect("/Home");
}
Parsa Karami
  • 642
  • 1
  • 7
  • 26