Skip to content

Commit

Permalink
Replace OnChallenge with OnTokenValidated event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Nov 3, 2024
1 parent d8a5ec5 commit fb36382
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/API/Grand.Api/Infrastructure/ApiAuthenticationRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fb36382

Please sign in to comment.