Clowning
Clowning

Reputation: 179

How to authorize only Anonymous to log in (ASP.NET 5)

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 ..

Upvotes: 0

Views: 522

Answers (1)

Parsa Karami
Parsa Karami

Reputation: 722

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

if (User.Identity.IsAuthenticated)
{
      Response.Redirect("/Home");
}

Upvotes: 1

Related Questions