am using Azure Ad authentication in my ASP.Net 4.8 MVC application. When authentication is expired and when user clicks on the link or button user get redirected to login page. So that is good.
However, I have a problem with AutoComplete textbox which is also available on the same page among buttons and link. If user leave the app open and comes back after page authentication cookie is expired and enter a value in autocomplete textbox, then textbox doesn't do anything, it works as there is no data to filter and doesn't even throw an error. I would expect it to redirect user to login page or refresh the token.
I suppose that could be known to those who uses Jquery or ajax functions or telerik controls to how to check for token. I am just new to all that.
Just in case if the code is needed so here it is.
<form action="@Url.Action("Transaction", "Job")" method="POST">
<div>
<div class="col-xs-4 k-content py text-left">
@{
try
{
@(Html.Kendo().AutoComplete()
.Name("searchValue") //chaninging the name of the class to UserModel
.DataTextField("SearchString") //DataTextField("dataField")
.Filter("contains")
.MinLength(2)
.HtmlAttributes(new {style = "width:100%"})
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAutoComplete", "Job")
.Data("onAdditionalData");
})
.ServerFiltering(true);
})
//.Events(e => e.DataBound("onDataBound"))
)
}
catch (Exception e)
{
//this.RedirectToAction("Reporting", "ReportManagement");
}
}