Explorar el Código

Fixes sequence validation error when both enable Challenge and Auth of dashboard authentication. #1097

master
Savorboard hace 2 años
padre
commit
011449b267
Se han modificado 1 ficheros con 11 adiciones y 10 borrados
  1. +11
    -10
      src/DotNetCore.CAP.Dashboard/CAP.BuilderExtension.cs

+ 11
- 10
src/DotNetCore.CAP.Dashboard/CAP.BuilderExtension.cs Ver fichero

@@ -111,6 +111,16 @@ namespace DotNetCore.CAP

internal static async Task<bool> Authentication(HttpContext context, DashboardOptions options)
{
var isAuthenticated = context.User?.Identity?.IsAuthenticated;

if (isAuthenticated == false && options.UseChallengeOnAuth)
{
await context.ChallengeAsync(options.DefaultChallengeScheme);
await context.Response.CompleteAsync();

return false;
}

if (options.UseAuth)
{
var result = await context.AuthenticateAsync(options.DefaultAuthenticationScheme);
@@ -125,16 +135,7 @@ namespace DotNetCore.CAP
}
}

var isAuthenticated = context.User?.Identity?.IsAuthenticated;

if (isAuthenticated == false && options.UseChallengeOnAuth)
{
await context.ChallengeAsync(options.DefaultChallengeScheme);
await context.Response.CompleteAsync();
return false;
}

return true;
}
}
}
}

Cargando…
Cancelar
Guardar