Skip to content

Commit d4c67f2

Browse files
committed
typo removing the subscription public key
1 parent 78980f6 commit d4c67f2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cas-dotnet-helpers/JWT.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task<bool> ValidateECCToken(string token, ECDsa publicKey)
2424
return result.IsValid;
2525
}
2626

27-
public string GenerateECCToken(string userId, bool isAdmin, ECDSAWrapper ecdsaKey, double hoursToAdd)
27+
public string GenerateECCToken(string userId, bool isAdmin, ECDSAWrapper ecdsaKey, double hoursToAdd, string? subscriptionPublicKey = null)
2828
{
2929
var handler = new JsonWebTokenHandler();
3030
DateTime now = DateTime.UtcNow;
@@ -33,6 +33,10 @@ public string GenerateECCToken(string userId, bool isAdmin, ECDSAWrapper ecdsaKe
3333
new Claim(Constants.TokenClaims.Id, userId),
3434
new Claim(Constants.TokenClaims.IsAdmin, isAdmin.ToString())
3535
};
36+
if (subscriptionPublicKey != null)
37+
{
38+
claims.Add(new Claim(Constants.TokenClaims.SubscriptionPublicKey, subscriptionPublicKey));
39+
}
3640
string token = handler.CreateToken(new SecurityTokenDescriptor
3741
{
3842
Issuer = "https://cryptographicapiservices.com",

cas-dotnet-helpers/cas-helpers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Nullable>enable</Nullable>
88
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
99
<Title>cas-helpers</Title>
10-
<Version>1.0.23</Version>
10+
<Version>1.0.24</Version>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

0 commit comments

Comments
 (0)