diff --git a/src/API/Grand.Api/Infrastructure/ApiAuthenticationRegistrar.cs b/src/API/Grand.Api/Infrastructure/ApiAuthenticationRegistrar.cs index ddfeca6e1..670ff180b 100644 --- a/src/API/Grand.Api/Infrastructure/ApiAuthenticationRegistrar.cs +++ b/src/API/Grand.Api/Infrastructure/ApiAuthenticationRegistrar.cs @@ -35,12 +35,7 @@ public void AddAuthentication(AuthenticationBuilder builder, IConfiguration conf context.Response.StatusCode = 401; context.Response.ContentType = "text/plain"; await context.Response.WriteAsync(context.Exception.Message); - }, - OnChallenge = context => - { - context.HandleResponse(); - return Task.CompletedTask; - }, + }, OnTokenValidated = async context => { try @@ -88,12 +83,7 @@ public void AddAuthentication(AuthenticationBuilder builder, IConfiguration conf context.Response.StatusCode = 401; context.Response.ContentType = "text/plain"; await context.Response.WriteAsync(context.Exception.Message); - }, - OnChallenge = context => - { - context.HandleResponse(); - return Task.CompletedTask; - }, + }, OnTokenValidated = async context => { try