Skip to content

Commit e56d6bb

Browse files
committed
fix
1 parent d972b89 commit e56d6bb

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

src/Services/Identity/Identity.API/Pages/Consent/Index.cshtml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private ViewModel CreateConsentViewModel(AuthorizationRequest request)
165165
.ToArray();
166166

167167
var resourceIndicators = request.Parameters.GetValues(OidcConstants.AuthorizeRequest.Resource) ??
168-
Enumerable.Empty<string>();
168+
Enumerable.Empty<string>();
169169
var apiResources =
170170
request.ValidatedResources.Resources.ApiResources.Where(x => resourceIndicators.Contains(x.Name));
171171

@@ -190,8 +190,8 @@ private ViewModel CreateConsentViewModel(AuthorizationRequest request)
190190
if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess)
191191
{
192192
apiScopes.Add(CreateOfflineAccessScope(Input == null ||
193-
Input.ScopesConsented.Contains(Duende.IdentityServer
194-
.IdentityServerConstants.StandardScopes.OfflineAccess)));
193+
Input.ScopesConsented.Contains(Duende.IdentityServer
194+
.IdentityServerConstants.StandardScopes.OfflineAccess)));
195195
}
196196

197197
vm.ApiScopes = apiScopes;

src/Services/Identity/Identity.API/Pages/ExternalLogin/Callback.cshtml.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ public async Task<IActionResult> OnGet()
4040
{
4141
// read external identity from the temporary cookie
4242
var result = await HttpContext.AuthenticateAsync(IdentityServerConstants.ExternalCookieAuthenticationScheme);
43-
if (result.Succeeded != true)
43+
if (!result.Succeeded)
4444
{
4545
throw new InvalidOperationException($"External authentication error: {result.Failure}");
4646
}
4747

4848
var externalUser = result.Principal ??
49-
throw new InvalidOperationException("External authentication produced a null Principal");
49+
throw new InvalidOperationException("External authentication produced a null Principal");
5050

5151
if (_logger.IsEnabled(LogLevel.Debug))
5252
{
@@ -59,11 +59,11 @@ public async Task<IActionResult> OnGet()
5959
// the most common claim type for that are the sub claim and the NameIdentifier
6060
// depending on the external provider, some other claim type might be used
6161
var userIdClaim = externalUser.FindFirst(JwtClaimTypes.Subject) ??
62-
externalUser.FindFirst(ClaimTypes.NameIdentifier) ??
63-
throw new InvalidOperationException("Unknown userid");
62+
externalUser.FindFirst(ClaimTypes.NameIdentifier) ??
63+
throw new InvalidOperationException("Unknown userid");
6464

6565
var provider = result.Properties.Items["scheme"] ??
66-
throw new InvalidOperationException("Null scheme in authentication properties");
66+
throw new InvalidOperationException("Null scheme in authentication properties");
6767
var providerUserId = userIdClaim.Value;
6868

6969
// find external user
@@ -137,17 +137,17 @@ private async Task<ApplicationUser> AutoProvisionUserAsync(string provider, stri
137137

138138
// user's display name
139139
var name = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.Name)?.Value ??
140-
claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
140+
claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
141141
if (name != null)
142142
{
143143
filtered.Add(new Claim(JwtClaimTypes.Name, name));
144144
}
145145
else
146146
{
147147
var first = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.GivenName)?.Value ??
148-
claims.FirstOrDefault(x => x.Type == ClaimTypes.GivenName)?.Value;
148+
claims.FirstOrDefault(x => x.Type == ClaimTypes.GivenName)?.Value;
149149
var last = claims.FirstOrDefault(x => x.Type == JwtClaimTypes.FamilyName)?.Value ??
150-
claims.FirstOrDefault(x => x.Type == ClaimTypes.Surname)?.Value;
150+
claims.FirstOrDefault(x => x.Type == ClaimTypes.Surname)?.Value;
151151
if (first != null && last != null)
152152
{
153153
filtered.Add(new Claim(JwtClaimTypes.Name, first + ' ' + last));

src/Services/Order.Command/Order.Command.Application/Orders/Queries/GetOrderById/GetOrderByIdQueryHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public async Task<GetOrdersByIdResult> Handle(GetOrdersByIdQuery request, Cancel
2323
x => x.Id.Equals(OrderId.From(orderId)) && x.CustomerId.Equals(CustomerId.From(customerId)) &&
2424
x.DeleteDate == null, cancellationToken);
2525

26-
if (order is null)
27-
throw new OrderNotFoundExceptions(orderId);
26+
if (order is null) throw new OrderNotFoundExceptions(orderId);
2827

2928
var result = MapResult(order);
3029
_logger.Information("Successfully retrieved orders by id.");

src/Services/Order.Command/Order.Command.Infrastructure/Order.Command.Infrastructure.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<!-- <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL"/>-->
1514
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
1615
<PrivateAssets>all</PrivateAssets>
1716
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -22,5 +21,4 @@
2221
<Folder Include="Data\Extensions\"/>
2322
</ItemGroup>
2423

25-
</Project>
26-
24+
</Project>

src/Services/Shared/Configurations/ConfigurationsExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static bool TrySetConfiguration<T>(
2727
public static T TryGetValidatedOptions<T>(this ConfigurationManager configurationManager) where T : class
2828
{
2929
var options = configurationManager.Get<T>() ??
30-
throw new InvalidOperationException($"Failed resolving {typeof(T).FullName}.");
30+
throw new InvalidOperationException($"Failed resolving {typeof(T).FullName}.");
3131

3232
var validator = new DataAnnotationsValidateRecursiveOptions<T>(string.Empty);
3333
var validationResult = validator.Validate(string.Empty, options);

0 commit comments

Comments
 (0)