From 2d0d82dab4c4b49aaaacf4b03a3242ec63bfd09f Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 22 Nov 2024 23:55:04 -0800 Subject: [PATCH] Some code cleanup - We can use Ok since the type is public now --- Todo.Api/Users/UsersApi.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Todo.Api/Users/UsersApi.cs b/Todo.Api/Users/UsersApi.cs index 0308c5c..cb89119 100644 --- a/Todo.Api/Users/UsersApi.cs +++ b/Todo.Api/Users/UsersApi.cs @@ -18,7 +18,7 @@ public static RouteGroupBuilder MapUsers(this IEndpointRouteBuilder routes) // The MapIdentityApi doesn't expose an external login endpoint so we write this custom endpoint that follows // a similar pattern - group.MapPost("/token/{provider}", async Task> (string provider, ExternalUserInfo userInfo, UserManager userManager, SignInManager signInManager) => + group.MapPost("/token/{provider}", async Task, SignInHttpResult, ValidationProblem>> (string provider, ExternalUserInfo userInfo, UserManager userManager, SignInManager signInManager) => { var user = await userManager.FindByLoginAsync(provider, userInfo.ProviderKey); @@ -44,10 +44,7 @@ public static RouteGroupBuilder MapUsers(this IEndpointRouteBuilder routes) } return TypedResults.ValidationProblem(result.Errors.ToDictionary(e => e.Code, e => new[] { e.Description })); - }) - // Add the open API response for 200 since AccessTokenResponse - // is internal and we don't want to duplicate it. - .Produces(); + }); return group; }