Hi,
It seems that the logging event is happening somewhere on the background. I have found out a simple workaround.
Find thish piece of code:
else
{
if (DefaultTargetUrl != "")
{
URLHelper.Redirect(ResolveUrl(DefaultTargetUrl));
}
else
{
URLHelper.Redirect(URLRewriter.CurrentURL);
}
}
Next you can insert your validation before url redirect. If the validation fails you can simply logout the user. It can look like this:
else
{
if (DefaultTargetUrl != "")
{
URLHelper.Redirect(ResolveUrl(DefaultTargetUrl));
}
else
{
// validation logic here
if (ValidationFails == true)
{
CMSContext.LogoutUser();
}
URLHelper.Redirect(URLRewriter.CurrentURL);
}
Its a workaround, but it should do the trick.
Please let me know how it works.
Kind regards,
Richard Sustek