I have a% custom [Authorize]
that extends from AuthorizeCore
in which I do a validation to return a true
or false
, until there all right, if I enter my page and I'm not logged in, it redirects me to my default page.
But when doing a post of some form this does not work, it simply does not do anything, it was debugging the code and it effectively enters the validation and returns what should return but does not redirect to where it should, but it does not do anything.
Who knows why this happens or am I wrongly applying [Authorize]
?
public class MyAuthorization : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
bool isNotValid = true;
if (isNotValid )
return false;
return true;
}
}