Skip to content

Commit 91c2dc7

Browse files
committed
use ctor instead of property initialisation
1 parent 191eea3 commit 91c2dc7

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthForAuthorizationTokenService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ public class EasyAuthForAuthorizationTokenService : IEasyAuthAuthentificationSer
2727
private static readonly Func<IHeaderDictionary, string, bool> IsHeaderSet =
2828
(headers, headerName) => !string.IsNullOrEmpty(headers[headerName].ToString());
2929

30-
private readonly ProviderOptions defaultOptions = new ProviderOptions(typeof(EasyAuthForAuthorizationTokenService).Name)
31-
{
32-
NameClaimType = ClaimTypes.Spn,
33-
RoleClaimType = "roles"
34-
};
30+
private readonly ProviderOptions defaultOptions = new ProviderOptions(typeof(EasyAuthForAuthorizationTokenService).Name, ClaimTypes.Spn, "roles");
3531

3632
private readonly ILogger<EasyAuthForAuthorizationTokenService> logger;
3733

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthWithHeaderService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ public class EasyAuthWithHeaderService : IEasyAuthAuthentificationService
2626
private static readonly Func<IHeaderDictionary, string, bool> IsHeaderSet =
2727
(headers, headerName) => !string.IsNullOrEmpty(headers[headerName].ToString());
2828

29-
private readonly ProviderOptions defaultOptions = new ProviderOptions(typeof(EasyAuthWithHeaderService).Name)
30-
{
31-
NameClaimType = ClaimTypes.Email,
32-
RoleClaimType = ClaimTypes.Role
33-
};
29+
private readonly ProviderOptions defaultOptions = new ProviderOptions(typeof(EasyAuthWithHeaderService).Name, ClaimTypes.Email, ClaimTypes.Role);
3430

3531
/// <summary>
3632
/// Initializes a new instance of the <see cref="EasyAuthWithHeaderService"/> class.

0 commit comments

Comments
 (0)