I just upgraded my project (ASP.NET Web with Razor - No MVC) from ServiceStack version 5.10 to 6.2 and the HtmlRedirect stopped working.
When I run the application it takes me to the default service(which secure) but not to the login screen. But, when I type “http://localhost/xyz/login” it takes me to the login screen.
Below is the stripped down version of the Configure method under AppHost:
public override void Configure(Container container)
{
//Configure JsConfig
SetConfig(new HostConfig
{
//...
WebHostPhysicalPath = MapProjectPath("~/wwwroot"),
//...
});
PreRequestFilters.Add((req, res) =>
{
//Pre Request Filters
//...
});
this.GlobalRequestFiltersAsync.Add(async (httpReq, httpResp, requestDto) =>
{
//Global Request Filters
//...
});
this.GlobalHtmlErrorHttpHandler = new RazorHandler("/oops");
this.ServiceExceptionHandlers.Add((httpReq, request, exception) =>
{
//Handle Service Exceptions
//...
});
Plugins.Add(new AuthFeature(() => new AppUserSession(),
new IAuthProvider[] {
new CustomCredentialsAuthProvider(),
new CustomBasicAuthProvider()
})
{ HtmlRedirect = VirtualPathUtility.ToAbsolute("/login"), GenerateNewSessionCookiesOnAuthentication = true, DeleteSessionCookiesOnLogout = true, });
}
VS: 2017
.NET Framework: 4.8
OS: Windows 10