Skip to content

Commit 2d0d82d

Browse files
committed
Some code cleanup
- We can use Ok<AccessTokenResponse> since the type is public now
1 parent fb0032e commit 2d0d82d

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Todo.Api/Users/UsersApi.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static RouteGroupBuilder MapUsers(this IEndpointRouteBuilder routes)
1818

1919
// The MapIdentityApi<T> doesn't expose an external login endpoint so we write this custom endpoint that follows
2020
// a similar pattern
21-
group.MapPost("/token/{provider}", async Task<Results<SignInHttpResult, ValidationProblem>> (string provider, ExternalUserInfo userInfo, UserManager<TodoUser> userManager, SignInManager<TodoUser> signInManager) =>
21+
group.MapPost("/token/{provider}", async Task<Results<Ok<AccessTokenResponse>, SignInHttpResult, ValidationProblem>> (string provider, ExternalUserInfo userInfo, UserManager<TodoUser> userManager, SignInManager<TodoUser> signInManager) =>
2222
{
2323
var user = await userManager.FindByLoginAsync(provider, userInfo.ProviderKey);
2424

@@ -44,10 +44,7 @@ public static RouteGroupBuilder MapUsers(this IEndpointRouteBuilder routes)
4444
}
4545

4646
return TypedResults.ValidationProblem(result.Errors.ToDictionary(e => e.Code, e => new[] { e.Description }));
47-
})
48-
// Add the open API response for 200 since AccessTokenResponse
49-
// is internal and we don't want to duplicate it.
50-
.Produces<AccessTokenResponse>();
47+
});
5148

5249
return group;
5350
}

0 commit comments

Comments
 (0)