Skip to content

Commit c448679

Browse files
authored
Apply suggestion from @maartenba
1 parent ef15079 commit c448679

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

  • astro/src/content/docs/identityserver/troubleshooting

astro/src/content/docs/identityserver/troubleshooting/index.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,25 +304,25 @@ When dealing with external authentication, you may want to implement `OnTicketRe
304304
```csharp
305305
// Program.cs
306306
services.AddAuthentication()
307-
.AddOpenIdConnect("oidc", options =>
308-
{
309-
...
310-
311-
options.Events = new OpenIdConnectEvents()
307+
.AddOpenIdConnect("oidc", options =>
312308
{
313-
OnTicketReceived = context =>
314-
{
315-
var identities = context.Principal?.Identities ?? Enumerable.Empty<ClaimsIdentity>();
316-
foreach (var identity in identities)
317-
{
318-
var removedClaim = identity.FindFirst("unused-custom-claim");
319-
_ = identity.TryRemoveClaim(removedClaim);
320-
}
321-
322-
return Task.CompletedTask;
323-
}
324-
};
325-
});
309+
// ...
310+
311+
options.Events = new OpenIdConnectEvents()
312+
{
313+
OnTicketReceived = context =>
314+
{
315+
var identities = context.Principal?.Identities ?? Enumerable.Empty<ClaimsIdentity>();
316+
foreach (var identity in identities)
317+
{
318+
var removedClaim = identity.FindFirst("unused-custom-claim");
319+
_ = identity.TryRemoveClaim(removedClaim);
320+
}
321+
322+
return Task.CompletedTask;
323+
}
324+
};
325+
});
326326
```
327327

328328
### Use Server-side Sessions

0 commit comments

Comments
 (0)