Ejemplo n.º 1
0
 /// <summary>
 /// Ensures the redirect required by the OWIN Security middleware is properly handled by DotVVM client library.
 /// </summary>
 public static void ApplyRedirectResponse(IOwinContext context, string redirectUri)
 {
     if (context.Response.StatusCode == (int)HttpStatusCode.Unauthorized)
     {
         DotvvmRequestContextExtensions.SetRedirectResponse(DotvvmRequestContext.GetCurrent(DotvvmMiddleware.ConvertHttpContext(context)), redirectUri, (int)HttpStatusCode.Redirect, true);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Ensures the redirect required by the ASP.NET Core Security middleware is properly handled by DotVVM client library.
 /// </summary>
 public static Task ApplyRedirectResponse(HttpContext context, string redirectUri)
 {
     DotvvmRequestContextExtensions.SetRedirectResponse(DotvvmRequestContext.GetCurrent(DotvvmMiddleware.ConvertHttpContext(context)), redirectUri, (int)HttpStatusCode.Redirect, allowSpaRedirect: false);
     throw new DotvvmInterruptRequestExecutionException();
 }