I have actions in different controllers which are decorated with [Authorize(Roles = "admin")] and they are working fine.But the problem is that they always redirect to login page even if the user is loged in.for example following actions redirect to login page even if the user is loged in
[Authorize(Roles = "admin")]
[HttpPost, ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
VAT vat = db.VAT.Find(id);
db.VAT.Remove(vat);
db.SaveChanges();
return RedirectToAction("Index");
}
Can I redirect to other page if user is loged in or stop redirecting the page